Thread overview
[Issue 13533] std.datetime should support custom parsing and formatting functions
[Issue 13533] DateTime.fromSimpleString should accept numerical months
Sep 26, 2014
Martin Nowak
[Issue 13533] DateTime.fromISOExtString should also accept space separator (instead of 'T')
Sep 26, 2014
Martin Nowak
Oct 07, 2014
Jonathan M Davis
Oct 21, 2014
Martin Nowak
Oct 22, 2014
Martin Nowak
Oct 22, 2014
Jonathan M Davis
Nov 28, 2015
Chris Wright
Jun 26, 2017
Vladimir Panteleev
Dec 17, 2022
Iain Buclaw
September 26, 2014
https://issues.dlang.org/show_bug.cgi?id=13533

--- Comment #1 from Martin Nowak <code@dawg.eu> ---
Replacing the T with a space seems to be a small deviation from ISO8601 used by some people for better readability, so the correct place for this would be fromISOExtString.

--
September 26, 2014
https://issues.dlang.org/show_bug.cgi?id=13533

Martin Nowak <code@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|DateTime.fromSimpleString   |DateTime.fromISOExtString
                   |should accept numerical     |should also accept space
                   |months                      |separator (instead of 'T')

--
October 07, 2014
https://issues.dlang.org/show_bug.cgi?id=13533

Jonathan M Davis <jmdavisProg@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg@gmx.com

--- Comment #2 from Jonathan M Davis <jmdavisProg@gmx.com> ---
Honestly, I think that toSimpleString should just be gotten rid of. It was a mistake to include it. It's only there because Boost had it.

Regardless, I think that what's really needed here is either that a string like "2014-09-26 10:20:30 +0200" should be mutated to match the ISO extended format by replacing the first space with a T and removing the second space, or it should be solved with custom date-time formatting functionality, which std.datetime really should have but which I haven't gotten to yet. I do not think that it makes sense to make any of the from*String functions lax in what they accept. I think that that sort of thing is almost always a bad idea. I think that the from*String functions should only accept what their corresponding to*String functions emit, which is what is standard. The only exception is that the number of decimal places in the fractional seconds isn't fixed, because the standard doesn't specify that. Everything else is exactly the same on both sides.

--
October 21, 2014
https://issues.dlang.org/show_bug.cgi?id=13533

--- Comment #3 from Martin Nowak <code@dawg.eu> ---
(In reply to Jonathan M Davis from comment #2)
> it should be solved with custom date-time formatting functionality, which std.datetime really should have but which I haven't gotten to yet.

Yeah, custom parsing seems the way to go here.

--
October 22, 2014
https://issues.dlang.org/show_bug.cgi?id=13533

Martin Nowak <code@dawg.eu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|DateTime.fromISOExtString   |std.datetime should support
                   |should also accept space    |custom parsing and
                   |separator (instead of 'T')  |formatting functions

--- Comment #4 from Martin Nowak <code@dawg.eu> ---
Renamed the enhancement request.

For all the common types DateTime, TimeOfDay, Date, SysTime there should be parse and format functions that accept custom format strings.

It would make sense to use a syntax similar to strftime and strptime and also have a look at other programming languages.

If it can be used for optimization then format strings as template argument might make sense. If well done those could even replace the hand-written from*String/to*String methods.

Is there a specific reason that SimpleTimeZone.fromISOString isn't public?

--
October 22, 2014
https://issues.dlang.org/show_bug.cgi?id=13533

--- Comment #5 from Jonathan M Davis <issues.dlang@jmdavisProg.com> ---
(In reply to Martin Nowak from comment #4)
> Is there a specific reason that SimpleTimeZone.fromISOString isn't public?

It was never designed to be public. It's just a helper function for the from*String functions on SysTime. There's nothing on any of the TimeZone classes for converting to or from strings.

Though that reminds me... I need to create a bug report and fix how to/fromISOString deal with time zones, because they're dealt with exactly the same way that the to/fromISOExtString deals with them (including the : between the hours and minutes), and I'm pretty sure that that's not legit for non-extended ISO (though I need to verify that).

--
November 28, 2015
https://issues.dlang.org/show_bug.cgi?id=13533

Chris Wright <dhasenan@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dhasenan@gmail.com

--
June 26, 2017
https://issues.dlang.org/show_bug.cgi?id=13533

Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrej.mitrovich@gmail.com

--- Comment #6 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ---
*** Issue 17558 has been marked as a duplicate of this issue. ***

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=13533

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--