About the timing of fetching in DeviceTimeAns

I get the time from the gateway reply command DeviceTimeAns as shown in the picture.

First of all, is the time correct? If so, how do I convert to UTC? I don’t understand the conversion algorithm.


Please format your post correctly, all text, code etc. you can post in between </>

So you want to convert a epoch to UCT?

Sorry, this is my bad habit of Posting. Yes, I want to convert an epoch to UCT.

Fix your bad habit please :slight_smile: we are volunteers helping, help us to help you.

It is the nanoseconds from Thursday, January 1, 1970 12:00:00 AM time, so just add the nanoseconds.

But be aware some might express it in seconds, milliseconds, microseconds and nanoseconds.

No, it’s 1663316472

Google comes up with sooooo many hits for this.

And frankly, the Unix time format is like breathing, it’s just known, so please please consider using Google first

1 Like

When I use the DEVICE_TIME_REQ command, in SRV_MAC_DEVICE_TIME_ANS I read that the returned GPS time is 1669186181 and the converted UTC time is Nov 27, 2032 06:49:23. Obviously this is the wrong value. Why does this happen?

Is this time generated by the gateway’s GPS or by the server?

I provided an answer to the exact same question under About the timing of fetching in DeviceTimeAns · Discussion #1388 · Lora-net/LoRaMac-node · GitHub

@orange_zouxiangcheng, please do not double post, even cross-site - the number of people proactively helping in the LoRaWAN space is quite small so it’s a duplication of resources.

I’m sorry, I was in a bit of a hurry because of the project schedule. It won’t happen again.