You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by "Kalle Niemitalo (Jira)" <ji...@apache.org> on 2024/10/16 14:11:00 UTC
[jira] [Updated] (AVRO-4080) C# local-timestamp-* conversions are affected by local time zone
[ https://issues.apache.org/jira/browse/AVRO-4080?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kalle Niemitalo updated AVRO-4080:
----------------------------------
Attachment: LocalTimestampTest.cs
> C# local-timestamp-* conversions are affected by local time zone
> ----------------------------------------------------------------
>
> Key: AVRO-4080
> URL: https://issues.apache.org/jira/browse/AVRO-4080
> Project: Apache Avro
> Issue Type: Bug
> Components: csharp, logical types
> Affects Versions: 1.12.0
> Reporter: Kalle Niemitalo
> Priority: Major
> Attachments: LocalTimestampTest.cs
>
>
> 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. TimeZoneInfo.Local should not affect these methods at all.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)