[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:09:35 UTC 2024


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

--- Comment #6 from Jonathan M Davis <issues.dlang at jmdavisProg.com> ---
(In reply to Carsten Schlote from comment #5)
> Good point. So I move my changes to SysTime, if this is the better place for
> it.

SysTime already supports fractional seconds. This already compiles and runs
just fine:

---
void main()
{
    import std.datetime;

    auto dt =
cast(DateTime)SysTime.fromISOExtString("2024-08-15T08:13:23.000");

    assert(dt.year == 2024);
    assert(dt.month == 8);
    assert(dt.day == 15);
    assert(dt.hour == 8);
    assert(dt.minute == 13);
    assert(dt.second == 23);
}
---

--


More information about the Digitalmars-d-bugs mailing list