-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Utils.timestamp() currently generates timestamps in the following format:
2022-01-20T17:21:12+00:00
For some reason the default output of Date().toISOString() is modified so that it ends in "+00:00" rather than "Z". This is probably because that's the format used by the examples do in the Web Thing API specification.
The latest draft of the W3C WoT Profile specification constrains the date format so that it must end in "Z".
I therefore propose changing the timestamp method to return the raw output of Date().toISOString() rather than modify it, so that datestamps look like:
2011-10-05T14:48:00.000Z
Before doing this we should check if it breaks anything.
Also, double check that the milliseconds portion of the datestamp is expected by WoT Profile.
Note: These timestamps are used in action resources in the gateway's API to show the requested and completed times of an action, and also for the timestamps of events. I'm not really sure why the gateway uses this utility function from the add-on library and they can probably call Date().toISOString() directly instead. If this utility function isn't used anywhere else then it could probably just be removed.