Closed SheriefAlaa closed 4 years ago
All dates are in UTC. I even generated dates at server side and passed them to fitkit and it somehow doesn't fetch specific activities within an hour range.
Hey @SheriefAlaa did you found out what's the issue?
Hey @SheriefAlaa did you found out what's the issue?
Not in an optimal way. After digging deep into the Swift/Android code of the plugin, I have discovered that calling read with from/to dates that include timezone info is pretty useless because the plugin will not care about this since it uses Unix epochs.
What was a even bigger surprise that returned data dates were in local device time that did not carry timezone info too which in the end forced me to save dates without timezone.
Maybe there should be a line in the readme that warns users about this?
Thank you.
@krokyze ^
@SheriefAlaa unix epochs are timezone independent so calling read with from/to dates that include timezone info is not useless. Also returned DateTime is in local device time with timezone included.
The issue in your query is that for DateTime.parse("11/11/2019 11:39:00") you didn't add UTC time zone like this "11/11/2019 11:39:00z".
Hey,
I think I may have hit a bug.
How to reproduce: 1- create 3 walking/running/distance activities in a span of an hour. Let's say
11/11/2019 11:00:00PM
to12:00:00PM
2- The first activity will have a start date11/11/2019 11:00:00PM UTC
end date11/11/2019 11:15:00PM UTC
3- The second activity will have a start date11/11/2019 11:16:00PM UTC
end date11/11/2019 11:32:00PM UTC
4- The third activity will have a start date11/11/2019 11:40:00PM UTC
end date11/11/2019 11:50:00PM UTC
5- Query usingFitKit.read(DataType.DISTANCE, dateFrom: DateTime.parse("11/11/2019 11:39:00"), dateTo: DateTime.now().toUtc());
6- See how the query returns0
results.Any help would be much much appreciated. Thanks.