Skip to content

Conversation

klauspost
Copy link
Collaborator

This adds msgp:newtime file directive that will encode all time fields using the -1 extension as defined in the (revised) messagepack spec

ReadTime/ReadTimeBytes will now support both types natively, and will accept either as input.

Extensions should remain unaffected.

Fixes #300

This adds `msgp:newtime` file directive that will encode all time fields using the -1 extension as defined in the [(revised) messagepack spec](https://github.com/msgpack/msgpack/blob/master/spec.md#timestamp-extension-type)

ReadTime/ReadTimeBytes will now support both types natively, and will accept either as input.

Extensions should remain unaffected.

Fixes tinylib#300
@klauspost klauspost requested a review from philhofer October 29, 2024 18:12
@klauspost klauspost requested a review from philhofer October 29, 2024 19:22
@klauspost klauspost merged commit 4c71fd4 into tinylib:master Oct 30, 2024
4 checks passed
@klauspost klauspost deleted the add-official-timestamp branch October 30, 2024 08:42
@klauspost klauspost changed the title Add "newtime" directive to use official messagepack time format Add "newtime" directive to use official msgpack time format Oct 30, 2024
@klauspost klauspost mentioned this pull request Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

time.Time is not follow the msgpack spec.
2 participants