Timezone Error in TTN Swagger API TimeStamps


(Diliprajkumar) #1

Hi,
I notice that the timestamp of the data coming in the TTN console is correct.
Time in TTN Data Console
But the same data when i query and view it in the Swagger API, i see the time has been reduced by 1 hour.
See the RED Boxes in the image below
Time in TTN Swagger API
I think there is a Time Zone conversion error in TTN Data Storage Back End. Can you please show a fix as we ( @AkashCastelino ) are relying on accurate timestamps from TTN for the data analytics in our project?

Best Regards,
Dilip


(Arjan) #2

Did you notice the Z at the end of the ISO-8601 timestamp? That denotes you’re seeing a timestamp in Zulu-time, a.k.a. GMT, a.k.a. UTC; https://time.is/utc

TTN Console either shows your current timezone, or maybe GMT+1. (For me, that’s the same when not using daylight saving time.) If TTN Console is not using your local time zone, then you should check your computer’s time zone settings. If those are correct, then I guess you should file a bug about TTN Console using GMT+1 for all users.


(Diliprajkumar) #3

Hi Arjan (@arjanvanb),
Yes the TTN console is showing the current time of our locality (Saarbrücken) or may be it is getting the time from our browser.
I only have the problem with the time that is showing up in the Swagger API of TTN Data Storage which is wrong? So this is a bug, is this forum post equivalent to reporting a bug?


(Arjan) #4

In winter, Saarbrücken is one hour ahead of UTC; https://time.is/compare/UTC/Saarbrücken

So the time in the JSON is correct. You can convert from UTC to whatever you like.

(Also, using UTC might save you from additional calculations when daylight saving time starts and ends.)