amazon-ion/ion-dotnet

Timestamp doesn't respect precision when output in text mode

CoderNate opened this issue · 0 comments

If I construct a Timestamp with Precision set to Amazon.IonDotnet.Timestamp.Precision.Day and write it with a text writer it outputs something like 2023-01-01T00:00:00.0000000-00:00. The text writer just calls ToString which doesn't look at Precision at all:

? this.DateTimeValue.ToString("O") + "-00:00"

It looks like the Java implementation does respect Precision in toString:
https://github.com/amazon-ion/ion-java/blob/a87fb20820f44b8bc6575926710b86a48f3149ce/src/com/amazon/ion/Timestamp.java#L2144