print yyyy-mm-dd

Jonathan M Davis via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Nov 24 02:54:50 PST 2014


On Monday, November 24, 2014 10:33:16 Suliman via Digitalmars-d-learn wrote:
> Is there any way to set separator? For example I want use '/' or
> ':'?

No. toISOString and toISOExtString support the ISO and Extended ISO formats
from the ISO standard, and std.datetime does not currently support custom
date/time string formatting (though it's on the todo list). The only
non-standard format that it currently suports is Boost's "simple" time via
toSimpleString, and it probably shouldn't even be there, since it just
confuses things without adding any real, useful functionality. Custom
date/time string formatting is what's really needed for non-standard
representations, especially because everyone has a different way that they
want to represent the time. However, most code really should use
toISOExtString, since it's standard and reasonably readable (e.g.
2014-11-24T02:53:12 as opposed to the non-extended ISO format of
20141124T025312).

- Jonathan M Davis



More information about the Digitalmars-d-learn mailing list