[Issue 24704] DateTime.fromISOExtString Does Not Support ISO8601 Time Unit Fractions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Aug 16 07:19:03 UTC 2024


https://issues.dlang.org/show_bug.cgi?id=24704

--- Comment #10 from Vijay Nayar <madric at gmail.com> ---
As a point of reference, the approach taken by Java's LocalTime (which has
nanosecond precision) when given a string that has more data than it can
handle, is to throw a parse exception.

E.g. the following action produces the following error:

```
// 10 fraction digits, 1 more than is supported
LocalTime myTime = LocalTime.parse("08:15:23.12345678910")
```

```
Exception in thread "main" java.time.format.DateTimeParseException: Text
'08:15:23.12345678910' could not be parsed, unparsed text found at index 18
```

--


More information about the Digitalmars-d-bugs mailing list