Hacker News new | ask | show | jobs
by SideburnsOfDoom 1088 days ago
As I put in another comment, your class library might have a type that is equivalent to ISO 8601 data, indeed is convertible to and from it, but is a binary representation at runtime compatible with other types in the language.

So this technically isn't ISO8601, and certainly isn't "ISO8601 in a string", which is an _interchange format_ between application with potentially very different runtimes. I don't really recommend treating ISO8601 dates as mere strings, unless you intend to pass them through without even looking at the contents.

I refer to https://learn.microsoft.com/en-us/dotnet/api/system.datetime...

Use types that support ISO8601 with an offset, always.

The docs even say that, even if many are not aware:

> consider DateTimeOffset as the default date and time type for application development.

https://learn.microsoft.com/en-us/dotnet/standard/datetime/c...