I see there are two types of sortable datetime patterns i can format my strings on…
- SortableDateTimePattern outputs a value with a T in the middle between date and time
- UniversalSortableDateTimePattern outputs a value with a Z in the end after the time
What are the implications of each in terms of interprocess communication such as data interchange in JSON, XML or tabular data.
Is any of the two by any chance adjusted to UTC automatically? (Seems not at first look)
I’ve read the poor level of documentation available on MSDN regarding the two, sadly they offer no insight on this question…
UniversalSortableDateTimePatternuses UTC. That’s what the Z at the end is for.Try this simple sample:
So long as your timezone is not UTC+0, you’ll notice the time is different on the second block.
My read on this would be to prefer
UniversalSortableDateTimePatternwhen used across timezones.