peteroupc / CBOR

A C# implementation of Concise Binary Object Representation (RFC 8949).
The Unlicense
206 stars 29 forks source link

DateTimeKind.Utc #27

Closed slipdef closed 5 years ago

slipdef commented 5 years ago

CBOR decodes any DateTime with Kind set to UTC. I would suggest to use Unspecified instead.

peteroupc commented 5 years ago

Be more specific. Do you think this is an error in the library when it converts DateTimes to CBOR objects, or when it converts CBOR objects to DateTimes? Note that the two CBOR tags are defined in terms of UTC, so it makes sense to convert objects with those tags to DateTimes with kind set to Utc.

slipdef commented 5 years ago

Note that the two CBOR tags are defined in terms of UTC - sorry, I missed that CBOR transfers date as Unix timestamp, so it makes sense to set Kind to UTC when decoding.