Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.11.1, 1.12.0
-
None
-
None
Description
In the C# implementation of logical types "local-timestamp-millis" and "local-timestamp-micros", the conversion between DateTime and Int64 depends on the local time zone of the process: ConvertToBaseValue calls DateTime.ToUniversalTime(), and ConvertToLogicalValue calls DateTime.ToLocalTime(). These time zone conversions should not be done. Instead, ConvertToBaseValue should discard DateTime.Kind, and ConvertToLogicalValue should set DateTimeKind.Unspecified.
According to the Avro 1.12.0 specification:
The time-millis logical type represents a time of day, with no reference to a particular calendar, time zone or date, with a precision of one millisecond.
As there is no reference to a time zone, the value must not be assumed to be in the local time zone of the process. The current C# implementation is not consistent with the Java implementation, either.
Attachments
Attachments
Issue Links
- Discovered while testing
-
AVRO-3078 C#: Logical type 'local-timestamp-millis'
- Resolved