DateTime formatting
bauss
jj_1337 at live.dk
Wed Dec 20 21:36:00 UTC 2017
On Wednesday, 20 December 2017 at 18:50:37 UTC, Jonathan M Davis
wrote:
> On Wednesday, December 20, 2017 14:30:55 bauss via
> Digitalmars-d-learn wrote:
>> I can't seem to find anything in Phobos that allows you to
>> specify custom formats for dates.
>>
>> Am I on my own or is there already such functionality?
>>
>> I'm interested in a formatter with the possibility to output
>> ex.:
>>
>> December 20th, 2017 10:00 AM
>>
>> All I could find was toSimpleString(), but it seem to use a
>> pre-defined format like:
>> YYYY-Mon-DD HH:MM:SS
>
> At present, the only formats that Phobos supports are ISO, ISO
> Extended, and Boost's simple time format. It does not yet have
> support for custom date/time formatting beyond constructing the
> string yourself from the properties on a DateTime or SysTime.
>
> This was posted about recently in the Announce group though:
>
> http://code.dlang.org/packages/datefmt
>
> It might do what you want.
>
> - Jonathan M Davis
Unfortunately I can't rely on any third-party packages for it :p
But thanks anyway @ both of you.
I'll write my own function to do it :)
More information about the Digitalmars-d-learn
mailing list