Export to Concept2 Logbook has wrong time

Issue #616 resolved
Carlos Reategui created an issue

The data should get exported with the users local time zone. Currently the time is getting converted to UTC before exporting and that causes it to be off on the C2 Logbook.

I see this on my imports from NK which I then export to the C2 Logbook.

Comments (15)

  1. Sander Roosendaal repo owner

    I noticed that my own workouts are shifted by 2 hours, so indeed it looks like it gets the time as UTC. Looks like this was happening already for a long time. I see workouts from March that are offset

  2. Carlos Reategui reporter

    I was looking at that as well. Are you sending the current time that the user has? i.e. as long as isoformat() is not changing timezones (which I believe it is not) and your timezone variable matches that time then I think it should be ok. Maybe if that timezone variable is blank set it to the users profile timezone. You might be right that C2 is starting to do something with that parameter.

  3. Sander Roosendaal repo owner

    Workouts with GPS data and naive date times (no time zone info) get a time zone based on the GPS coordinates. All other workout sources with “naive” date times and no GPS info get the users default time zone and I am assuming the reported time was in that time zone.

    Checks on this side

    • Does my time zone info match the TZ database (I think it should but better double check)
    • Does the workout time function not have a bug?

  4. Carlos Reategui reporter

    The time displayed for the NK entry that was emailed in is correct but can not remember if the TZ was set or not. I think it was. On the C2 auto import it looked like it was blank (or defaulted to the first one).

  5. Sander Roosendaal repo owner

    Time zone info in export to C2 is ‘Europe/Amsterdam’ if set to Europe/Amsterdam, correct in TZ Database.

    Workout time function gives duration in tenths of seconds, nothing to do with time zone and is correct.

    Changed the time from iso format to “%Y-%m-%d %H:%M:%S“ (2016-05-20 13:41:26). Need to see on deployment if this helps.

  6. Sander Roosendaal repo owner

    Looking at this, it seems that what I fixed on Import (C2 logbook reports workout End Time, Rowsandall workout Start Time) is not corrected for on export TO C2.

  7. Carlos Reategui reporter

    The timestamp format seems to better match the expected time format as seen in the examples in the dev doc. I guess we will see.

  8. Sander Roosendaal repo owner

    No I haven’t. Interesting suggestion, but I would like to understand the use cases. What can you do on the C2 side with it?

  9. Carlos Reategui reporter

    In the data table you can click the individual intervals and the chart/graph only shows you that segment.

    Here is an example from this morning using the Asensei app I use where they post as intervals (~4min warmup then 4x10mins/2min): https://log.concept2.com/profile/29950/log/53476230 https://log.concept2.com/profile/29950/log/53476230 This is what one imported from NK->Rowsandall: create intervals->C2 logbook. looks like: https://log.concept2.com/profile/29950/log/53450775 https://log.concept2.com/profile/29950/log/53450775

    As you can see, you are setting the separate splits per the intervals (which is nice to see - thank you) so it looks like it would not be too much more of a stretch to remove the rest splits and put the time and distance of those rest splits into the prior work split. The only tricky thing is how it would treat a 0 length work split for the first segment. Maybe special case when 1st segment is rest and put it in as a work segment with 0min/0meter rest.

  10. Sander Roosendaal repo owner

    I have deployed a fix which I tested on my own “Europe/Amsterdam” data set. Please monitor and report glitches and unexpected results here. Thanks.

  11. Carlos Reategui

    Did not work for me. Time and Timezone is correct in Rowsandall but not in the C2 Logbook. For example: https://rowsandall.com/rowers/workout/208f99a7/

    It has a start time of 07:33 and a duration of 43 minutes.

    I would expect C2 to have a time of 08:16 (i.e end time). However it has a time of 13:50. Looks like you are subtracting the duration (06:50) instead of adding it and then applying a timezone conversion by adding 7hrs hence the 13:50. I am UTC-7.

  12. Sander Roosendaal repo owner

    I apologize, my comment referred to the Import from C2, not the export to C2. 😞

    I am going to put logging in place and then I need you and I to compare notes. That’s the only way for me to build a good test set.

  13. Log in to comment