openambitproject / openambit

openambit
277 stars 82 forks source link

moves uploaded to movescount are synced to strava with wrong time #189

Open gustavo-iniguez-goya opened 6 years ago

gustavo-iniguez-goya commented 6 years ago

For example, move started on 10.06.2018 09:36: http://www.movescount.com/moves/move222902055

But in strava the time is +1 hour: 10:36 AM on Sunday, June 10, 2018 https://www.strava.com/activities/1629705645

The DateTime in the logs: 2018-06-10T09:36:22

If I sync the moves using movescount app, the time appears correctly on movescount and strava.

marguslt commented 6 years ago

I fiddled with this at some point, a crude proof of concept hack, but it worked for me back then - https://github.com/marguslt/openambit/commit/bb494b7c708099d45b0d02b0dafb548b7d4de7fa

sean-chester commented 6 years ago

With those changes I get the following error:

Failed to upload log (err code: QNetworkReply::NetworkError(ProtocolInvalidOperationError) ), movescount.com replied with " "\"There was an error deserializing the object of type Suunto.Movescount.Services.DataContracts.MoveContract. String was not recognized as a valid DateTime.\"" "

However, modifying commit 6e42279 with these few lines worked for me:

QDateTime get_utc( QDateTime const local_time )
{
    QDateTime UTCStartTime = local_time.toUTC();
    UTCStartTime.setTimeSpec(Qt::UTC);
    return UTCStartTime;
}

content.insert("UTCStartTime", dateTimeString( get_utc( localBaseTime )));
gustavo-iniguez-goya commented 6 years ago

I confirm that it works. Thank you @marguslt !

Since we're using just the first sample, I've put the code outside of the loop, but well, the thing is that it works.

centic9 commented 4 years ago

PR #210 tries to fix similar thing.

tfilo commented 4 years ago

Same problem here. I just compiled openambit from tag 0.5

centic9 commented 4 years ago

Can you try with latest from master as I believe the change was merged after 0.5 was tagged

tfilo commented 4 years ago

I now downloaded master, synced watch. Yesterday I recorded move at 16:12. (Local time in Slovakia, summer time (UTC+2)). In movescount it is showed with correct time. In strava I see 5:12 PM which is wrong. I uploaded log file from OpenAmbit to dropbox, you can see it here, If I can help in any way, let me know. https://www.dropbox.com/s/eojjgwtutkk7nuq/log_CCA5095101001300_2020_05_12_16_12_09.log?dl=0

tfilo commented 4 years ago

I tried manualy export GPX from movescount and import it manually to Strava and it works that way.