Getting UTC from the Notecard

Hi All,

I need to get a timestamp to the nearest minute. I tried using card.status but the time obtained from that does not increment. I have also card.location but the GPS is not enabled, nor does it have an antenna connected. Is there another notecard characteristic I can interrogate to get a UTC timestamp?

Thanks and regards,

Rob

Hi Rob.

What you want is card.time

Note - you will need to adjust the timestamp given with the offset given to get the UTC time.

Kimball

Hi Kimball,

Thank you. That is working.

Regards,

Rob

1 Like

Hi Again,

It has just dawned on me how much of a pain it is to adjust the time to UTC. Do you know what the minutes field is? Could it be the offset? I am on summer time and 60 minutes ahead of UTC.

{“minutes”:60,“lat”:52.32948750000003,“lon”:-0.06917187499996658,“area”:“Hemingford Grey ENG”,“country”:“GB”,“zone”:“BST,Europe/London”,“time”:1695839097}

Regards,

Rob

Hi Rob,

time is actually already in UTC and it can be trusted because Notecard is careful to only get the time from Notehub, not directly from a cell tower. That way you’ll not get inconsistent time readings as you move between towers. It also means you can trust the card.time when connected to wifi with one of the wifi-capable notecards.

You’re right that minutes, when it’s available, represents the difference between UTC and local time. But if all you need is UTC this is an unnecessary detail.

If you have any more questions, let me know,

-Carl

1 Like