Proposal for custom time string formatting in std.datetime

Jonathan M Davis jmdavisProg at gmx.com
Wed Dec 21 20:31:50 PST 2011


On Thursday, December 22, 2011 05:19:07 Vladimir Panteleev wrote:
> On Thursday, 22 December 2011 at 03:42:32 UTC, Jonathan M Davis
> 
> wrote:
> > http://jmdavis.github.com/d-programming-language.org/std_datetime.html
> 
> What is the purpose of %nyplus ?

It's what the ISO formats use. They put a + in front of the number if it's 
positive and exceeds 4 digits. %yplus would put the + there as long as the 
year is positive, whereas %4yplus puts it there if the year is > 9999.

> There should be presets for common standard date formats, like
> here:
> http://php.net/manual/en/class.datetime.php#datetime.constants.types

Those could be added, though I'd probably add them as additional flags. It 
already has %ctime and %mpeg7, but those are some good ones to add as well.

- Jonathan M Davis


More information about the Digitalmars-d mailing list