time_t to simple date string conversion

Steven Schveighoffer schveiguy at yahoo.com
Tue Apr 5 15:27:48 PDT 2011


On Tue, 05 Apr 2011 18:20:02 -0400, Jonathan M Davis <jmdavisProg at gmx.com>  
wrote:

> toSimpleString (which toString calls) does give the short version of the  
> month
> in it, but during the review process, a number of the folks reviewing   
> it were
> against putting code in there relating to printing the month out as a  
> name
> rather than a number, because that gets it to dealing locales. The  
> result is
> that the only stuff in std.datetime that does anything with the month's  
> name
> as a string is toSimpleString (and therefore toString) and  
> fromSimpleString on
> SysTime, Date, and DateTime. Everything else is numbers (though the  
> Month enum
> does use the 3-letter English abbreviations for the names of its enum  
> values).
>
> I wouldn't have minded having English-specific stuff in there with  
> locales
> being dealt with elsewhere, but it essentially got pushed out entirely,  
> so
> there's next to no English-specific stuff in there, and it will _all_ be  
> in
> locale stuff, if we ever _do_ any locale stuff.

I think I was one of those who pushed not to have the names in there.  I  
couldn't remember whether it had stayed in or not, hence my non-committal  
statement :)

I agree with the way it is then.  We do need some sort of locale package.   
But judging from Tango's, it's not a small task.

Thanks for clarifying.

BTW, slightly OT, have you considered reworking datetime's docs to look  
more like Andrei's new std.algorithm?  There's an awful lot of links at  
the top of that page in non-related order.  I really think we need to work  
on DDoc so that it generates more useful pages.

-Steve


More information about the Digitalmars-d-learn mailing list