Local MQTT Time Stamps
in Local MQTT
I note from the Blog https://medium.com/@joshua.cooper/glow-local-mqtt-f69b776b7af4 that the timestamp has a Z on the end to indicate UTC.
This is not part of the standard and several systems (notably PHP) do not process it correctly.
The timestamp should have "+00:00" on the end rather than the Z.
Comments
The timestamp is local (not Zulu) anyway.
Timestamp on mine seems to be Zulu time
Message 2 received on glow/xxxxx/STATE at 17:20:
{
"software": "v1.8.12",
"timestamp": "2022-06-13T16:20:32Z",
"hardware": "GLOW-IHD-01-1v4-SMETS2",
"ethmac": "xxxxx",
"smetsversion": "SMETS2",
"eui": "xxxxxx",
"zigbee": "1.2.5",
"han": {
"rssi": -63,
"status": "joined",
"lqi": 148
}
}
QoS: 0 - Retain: false
[quoting doesn't work for me]
"Timestamp on mine seems to be Zulu time"
The point is that timestamp with 'Z' is not correct vis the ISO standard - it is an option that many computer systems do not implement correctly.
The reply was to the comment from Dougie who stated that the timestamp is local time. Which it isn't on mine, it is UTC.
Are you referring to ISO 8601?
Sorry I was wrong. It is a Zulu timestamp so should be in the format yyyy-dd-mmThh:mm:ssZ.
And it seems that Z is acceptable in the ISO format as well.
And if PHP has an issue with it, then maybe this will help
https://php.watch/versions/8.0/date-utc-p-format#:~:text=The%20difference%20between%20P%20and,42%3A34%2B00%3A00
From Wikipedia ...
Coordinated Universal Time (UTC)[edit]
If the time is in UTC, add a Z directly after the time without a space. Z is the zone designator for the zero UTC offset. "09:30 UTC" is therefore represented as "09:30Z" or "T0930Z". "14:45:15 UTC" would be "14:45:15Z" or "T144515Z".
The Z suffix in the ISO 8601 time representation is sometimes referred to as "Zulu time" because the same letter is used to designate the Zulu time zone. However the ACP 121 standard that defines the list of military time zones makes no mention of UTC and derives the "Zulu time" from the Greenwich Mean Time[28] which was formerly used as the international civil time standard. GMT is no longer precisely defined by the scientific community and can refer to either UTC or UT1 depending on context.[29]