digitalmars.D.bugs - [Issue 8646] New: std.datetime ISO strings are incompatible with ISO 8601
- d-bugmail puremagic.com (20/20) Sep 12 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8646
- d-bugmail puremagic.com (22/22) Sep 12 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8646
- d-bugmail puremagic.com (11/11) Sep 12 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8646
- d-bugmail puremagic.com (12/12) Sep 12 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8646
- d-bugmail puremagic.com (6/6) Sep 12 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8646
http://d.puremagic.com/issues/show_bug.cgi?id=8646 Summary: std.datetime ISO strings are incompatible with ISO 8601 Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: nobody puremagic.com ReportedBy: jens.k.mueller gmx.de --- Comment #0 from jens.k.mueller gmx.de 2012-09-12 10:03:23 PDT --- According to http://en.wikipedia.org/wiki/ISO_8601 ISO 8601 date time strings contain nothing below seconds. But the std.datetime's ISO function contain values for this. Hence, it is currently incompatible with ISO 8601. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 12 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8646 Jonathan M Davis <jmdavisProg gmx.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |jmdavisProg gmx.com Resolution| |INVALID --- Comment #1 from Jonathan M Davis <jmdavisProg gmx.com> 2012-09-12 10:38:22 PDT --- It's perfectly legit. Reread the Times section. You can have "decimal fractions" (which is a really screwed up term IMHO, since decimals and fractions are different things, but whatever) to any of the three time elements - including seconds. The number of decimal places to use "needs to be agreed to by the communicating parties," but the notation is correct. If there's a problem, it's the fact that fromISOExtString doesn't accept variants of ISO-8601 that toISOExtString doesn't use (e.g. using a comma instead of a decimal or having decimal fractions for minutes). But they both follow the standard. There are other places online that fractional seconds are discussed as well. e.g. http://www.cl.cam.ac.uk/~mgk25/iso-time.html -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 12 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8646 --- Comment #2 from jens.k.mueller gmx.de 2012-09-12 12:42:16 PDT --- Thanks for your prompt reply. I see now that the standard allows for fractional seconds. In my use case I'm programming against against a specification that demands ISO 8601 conformity without fractional seconds. Is there an easy way to remove the fractional seconds? Because if there are no then toISOExtString() won't return them. My current workaround is quite tedious for this common operation. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 12 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8646 --- Comment #3 from Jonathan M Davis <jmdavisProg gmx.com> 2012-09-12 13:30:04 PDT --- Just strip the fractional seconds from the SysTime by setting its fracSec property to 0. So, something like sysTime.fracSec = FracSec.from!"msecs"(0); (I should probably add a static property to FracSec which gives you 0, but there isn't anything like that right now). Then when you call toISOString or toISOExtString, it doesn't have any fractional seconds, so the resultant string won't have them. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 12 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8646 --- Comment #4 from jens.k.mueller gmx.de 2012-09-12 13:49:21 PDT --- Thanks. This looks good. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Sep 12 2012