Hacker News new | ask | show | jobs
by mgh95 319 days ago
> What language actually allows a type definition for "ISO-8601 timestamp" that's complete?

It is absolutely possible to do this, and to generate client code which complies with ISO-8601 in JS/TS. Large amounts of financial services would not work if this was not the case.

See the c# support for ISO-8601 strings: https://learn.microsoft.com/en-us/dotnet/standard/base-types...

1 comments

You've misunderstood his statement and proven his point.

`DateTime` is not an ISO-8601 type. It can _parse_ an ISO-8601 formatted string.

And even past that, there are Windows-specific idiosyncrasies with how the `DateTime` class implements the parsing of these strings and how it stores the resulting value.

> `DateTime` is not an ISO-8601 type. It can _parse_ an ISO-8601 formatted string.

This is exactly the point: a string is just a data interchange format in the context of a DateTime, and C# provides (as far as I can tell) a complete way of accessing the ISO-8601 specification on the language object. It also supports type-safe generation of clients and client object (or struct) generation from the ISO-8601 string format.

> And even past that, there are Windows-specific idiosyncrasies with how the `DateTime` class implements the parsing of these strings and how it stores the resulting value.

Not really. The windows statements on the article (and I use this on linux for financial services software) are related to automated settings of the preferences for generated strings. All of these may be set within the code itself.

>The windows statements on the article

That was based on decades of experience in .NET and Windows. Not the article ;).

Ah. For what its worth, the only windows machine I have is used pretty much only to run steam. I can't really comment on c# on windows.