API Suggestion: Additional time format pattern for concise ISO8601 format #26362
Labels
api-needs-work
API needs work before it is approved, it is NOT ready for implementation
area-System.DateTime
Milestone
The following applies to
DateTime
,DateTimeOffset
and UTF8/UTF16.Motivation
Currently the time format pattern 'O', 'o' is the roundtrip pattern and the output of a formatted string looks like
2009-06-15T13:45:30.0000000Z
and quite often more like2009-06-15T13:45:30.0000000-00:00
. This is great for formatting, but the pattern specifies 7 fractional digits in a 100ns precision, this makes live complicated if the date format is produced by another programming language.According to https://nbsoftsolutions.com/blog/iso-8601-and-nanosecond-precision-across-languages python has 6, rust has 8, Go has 9 fractional digits.
I propose another format pattern, let's name it 'i' for discussion, which is basically the same as 'o' just with a relaxed requirement of fractional digits.
Formatting
Like 'o', but:
2009-06-15T13:45:30Z
)Parsing
Like 'o', but:
Side effects:
Timespan
Intended Audience:
Alternatives:
The text was updated successfully, but these errors were encountered: