__TIMESTAMP_UNIXEPOCH__ instead of useless __TIMESTAMP__?
Steven Schveighoffer
schveiguy at yahoo.com
Thu Jan 25 16:10:43 UTC 2018
On 1/25/18 4:39 AM, Walter Bright wrote:
> On 1/24/2018 11:18 AM, Timothee Cour wrote:
>> __TIMESTAMP__ is pretty useless:
>> `string literal of the date and time of compilation "www mmm dd
>> hh:mm:ss yyyy"`
>> eg:Wed Jan 24 11:03:56 2018
>> which is a weird non-standard format not understood by std.datetime.
>
> It's the format emitted by the Standard C library function asctime():
>
> http://pubs.opengroup.org/onlinepubs/009695399/functions/asctime.html
>
>> __DATE__ and __TIME__ are also pretty useless.
>
> These also match the format of the Standard C preprocessor macros
> __DATE__ and __TIME__.
We should support __ISOTIMESTAMP__ which is readable by std.datetime [1].
The compiler is in D after all, we can use it! Or at least, port enough
of std.datetime to display it :)
-Steve
[1]
https://dlang.org/phobos/std_datetime_systime.html#.SysTime.toISOExtString
More information about the Digitalmars-d
mailing list