Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change timestamp format used in gateway API #2910

Open
benfrancis opened this issue Jan 20, 2022 · 3 comments
Open

Change timestamp format used in gateway API #2910

benfrancis opened this issue Jan 20, 2022 · 3 comments
Assignees
Labels
Milestone

Comments

@benfrancis
Copy link
Member

Timestamps for actions and events in the gateway API are currently in the format 2022-01-20T17:21:12+00:00.

The latest draft of the W3C WoT Profile specification constrains the date format so that it must end in "Z".

If and when w3c/wot-profile#119 and w3c/wot-profile#127 land, I suggest changing action.ts and event.ts to use Date().toISOString() directly rather than Utils.timestamp(), which should output the expected date format.

See WebThingsIO/gateway-addon-node#106 for more information.

@benfrancis benfrancis added task w3c-compliance wot-profile W3C WoT Profile specification labels Jan 20, 2022
@benfrancis benfrancis added this to the 2.0 milestone Jan 20, 2022
@benfrancis benfrancis self-assigned this Jan 20, 2022
@benfrancis benfrancis changed the title Change timestamp format used in gateway API [Core Profile] Change timestamp format used in gateway API Jan 20, 2022
@adioanca
Copy link

Hi,
Both 119 and 127 were closed this year. Think it would be a good idea to move to .123 milisecond Z format.

(see my other comment in WebThingsIO/gateway-addon-node#106

@benfrancis
Copy link
Member Author

I agree.

See also: WebThingsIO/gateway-addon-node#106 (comment)

@benfrancis
Copy link
Member Author

The latest draft of WoT Profile only requires that timestamps conform to RFC3339, which does allow both numerical timezone offsets and "Z". As I understand it that means the timestamps used by the gateway do now comply with the specification.

However, I think we should still change the gateway to use Date().toISOString() directly to allow millisecond precision timestamps.

@benfrancis benfrancis removed w3c-compliance wot-profile W3C WoT Profile specification labels Mar 17, 2023
@benfrancis benfrancis changed the title [Core Profile] Change timestamp format used in gateway API Change timestamp format used in gateway API Mar 17, 2023
@benfrancis benfrancis moved this to Product Backlog in WebThings Gateway Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Product Backlog
Development

No branches or pull requests

2 participants