[Issue 13533] New: DateTime.fromSimpleString should accept numerical months

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Sep 25 21:04:09 PDT 2014


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

          Issue ID: 13533
           Summary: DateTime.fromSimpleString should accept numerical
                    months
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: Phobos
          Assignee: nobody at puremagic.com
          Reporter: code at dawg.eu

I often stumble over datetime strings in this format.
    2014-09-26 10:20:30 +0200

Most notably MySQL and Ruby's Time class use it. I haven't yet found a good way
to parse this format into a DateTime.
The function fromSimpleString will only accept date formats with abbreviated
months as in `2014-Sep-26 10:20:30 +0200`, fromISOExtString OTOH requires a 'T'
between the date and uses a different format for the timezone.

So it would be nice if Date.fromSimpleString accepted "2014-09-26".
Workarounds aren't really possible, e.g. because SimpleTimeZone.fromISOString
isn't accessible.

--


More information about the Digitalmars-d-bugs mailing list