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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Aug 15 17:32:33 UTC 2024


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

--- Comment #7 from Carsten Schlote <carsten.schlote at gmx.net> ---
Problem can be easily fixed like this:

```
    import std.datetime;

    auto b = SysTime.fromISOExtString("2024-08-15T08:13:23.000");
    assert("2024-Aug-15 08:13:23" == b.toString);
    auto c = SysTime.fromISOExtString("2024-08-15T08:13:23.25");
    assert("2024-Aug-15 08:13:23.25" == c.toString);

    auto d = SysTime(DateTime(2024, 8, 15, 13, 23, 25)).toISOExtString();
    assert("2024-08-15T13:23:25" == d);

    auto e = cast(DateTime)c;
    assert("2024-Aug-15 08:13:23" == e.toString);
```

--


More information about the Digitalmars-d-bugs mailing list