Card.location time different to card.status time

I am using two commands in different parts of my code to get the current time. When I get a GPS fix using card.location and manually when using card.status. Here is an example of the two commands run within minutes of each other.

{"req":"card.location"}
{"status":"GPS updated (13 sec, 49/49 dB SNR, 7/16 sats, HDOP 0.80) {gps-active} {gps-signal} {gps-sats} {gps}","mode":"periodic","lat":50.826175,"lon":-0.06369,"dop":0.8,"time":1686823094}

{"req":"card.status"}
{"status":"{normal}","storage":3,"time":1686815641}

The time returned by card.location is roughly 2 hours ahead of the time returned by card.status. Is this normal behaviour? The GPS time is the correct local time, but I am only 1 hour ahead of GMT, so this doesn’t quite explain it.

Is there a way to make both of these times the return the value same?

To add to this, if I run card.time, then card.status within seconds of each other, they also report different times

{"req":"card.time"}
{"minutes":60,"lat":50.825797500000022,"lon":-0.063839843749988743,"area":"England","country":"GB","zone":"BST,Europe/London","time":1686827642}
{"req":"card.status"}
{"status":"{normal}","storage":3,"time":1686815641,"cell":true,"journey":true}

Hi @spring and welcome to the Blues community!

The time returned by card.location is the time that the location data was acquired, not necessarily the current time.

The time returned by card.status is approximately when the Notecard was first powered up.

The time returned by card.time is the current time (as long as the Notecard has synced with Notehub at least once since being powered on). This is what you want to use to get the current time.

Hope this helps!

Rob

Thanks for the clarification, the API docs didn’t make this distinction clear. I will use card.time.

1 Like