Re: Get date at compile time

2017-05-26 Thread kdevel via Digitalmars-d-learn
On Saturday, 1 October 2016 at 15:00:29 UTC, pineapple wrote: Though I don't currently have any need for this feature I'd imagine that if I did I'd want the time in UTC, not locally You may invoke the compiler with TZ= prepended. (Linux)

Re: Get date at compile time

2016-10-02 Thread Jacob Carlborg via Digitalmars-d-learn
On 2016-10-01 17:00, pineapple wrote: Has there been consideration for adding separate integral tokens for day, month, year, etc? I think it would be better to implement a parse function for std.datetime which works at compile time. We need a parse function anyway. -- /Jacob Carlborg

Re: Get date at compile time

2016-10-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 1 October 2016 at 15:00:29 UTC, pineapple wrote: Has there been consideration for adding separate integral tokens for day, month, year, etc? Not that I'm aware of. The purpose of this is more for things like version and help strings (e.g. "MyApp built 1 Oct 2016") than for seriou

Re: Get date at compile time

2016-10-01 Thread pineapple via Digitalmars-d-learn
On Saturday, 1 October 2016 at 14:43:31 UTC, Adam D. Ruppe wrote: On Saturday, 1 October 2016 at 14:41:22 UTC, Andrew wrote: Is there any way to get the system date at compile time. Not exactly, but the special symbol __TIMESTAMP__ gets a string out of the compiler at build time. http://dla

Re: Get date at compile time

2016-10-01 Thread Andrew via Digitalmars-d-learn
On Saturday, 1 October 2016 at 14:43:31 UTC, Adam D. Ruppe wrote: On Saturday, 1 October 2016 at 14:41:22 UTC, Andrew wrote: Is there any way to get the system date at compile time. Not exactly, but the special symbol __TIMESTAMP__ gets a string out of the compiler at build time. http://dla

Re: Get date at compile time

2016-10-01 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 1 October 2016 at 14:41:22 UTC, Andrew wrote: Is there any way to get the system date at compile time. Not exactly, but the special symbol __TIMESTAMP__ gets a string out of the compiler at build time. http://dlang.org/spec/lex.html#specialtokens

Re: Get date at compile time

2016-10-01 Thread rikki cattermole via Digitalmars-d-learn
On 02/10/2016 3:41 AM, Andrew wrote: Hi, Is there any way to get the system date at compile time. I want something like: static string compileDate = Clock.currTime.toString; but that fails. Thanks very much Andrew https://dlang.org/spec/lex.html#specialtokens

Get date at compile time

2016-10-01 Thread Andrew via Digitalmars-d-learn
Hi, Is there any way to get the system date at compile time. I want something like: static string compileDate = Clock.currTime.toString; but that fails. Thanks very much Andrew