Date formatting in D

ikod via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Mar 7 12:52:39 PST 2017


On Tuesday, 7 March 2017 at 20:29:07 UTC, aberba wrote:
> I've been trying to figure out an inbuilt functionality in 
> phobos for formatting date. In my use case, I've been trying to 
> format current Unix timestamp to something like "Thu, 08 Mar 
> 2017 12:00:00 GMT".
>
> How do I go by this easily (Currently, long concatenation of 
> strings is what I'm thinking)?
>
> I saw this thread[1] from 2011 on similar issue. Has it been 
> resolved? What is the state of toCustomString?
>
> [1] 
> http://forum.dlang.org/post/mailman.673.1320367887.24802.digitalmars-d-learn@puremagic.com

Straightforward solution:

https://dlang.org/library/core/stdc/time/strftime.html
http://man7.org/linux/man-pages/man3/strftime.3.html

Maybe there is something better.


More information about the Digitalmars-d-learn mailing list