Dahomey.Cbor
Dahomey.Cbor copied to clipboard
In DateTimeConverter, let DateTime.Kind be unspecified if it is in fact unspecified
Currently, in DateTimeConverter, the DateTimeKind is set to Local if no timezone is specified. It would probably be more correct to let it be Unspecified. I know this is a breaking change, but maybe we could have a "UnspecifiedDateTimeKind" option on CborOptions similar to DateTimeFormat so that it is configurable? In my use case I need a DateTime to come back as Unspecified when no timezone details are present.
The same is also true for the case when the timezone details is in fact specified. Currently a DateTime is returned of type "Local", but this should probably also be Unspecifed.
fair enough when no timezone is specified. However, when a timezone is specified, I think it should be better to return the UTC equivalent because we need to calculate the offset from a reference. e.g. 1977-04-22T01:00:00-05:00 is equivalent to 1977-04-22T06:00:00Z