digitalmars.D.learn - Get date at compile time
- Andrew (7/7) Oct 01 2016 Hi,
- rikki cattermole (2/9) Oct 01 2016 https://dlang.org/spec/lex.html#specialtokens
- Adam D. Ruppe (4/5) Oct 01 2016 Not exactly, but the special symbol __TIMESTAMP__ gets a string
- Andrew (4/9) Oct 01 2016 perfect, works a treat.
- pineapple (9/14) Oct 01 2016 Has there been consideration for adding separate integral tokens
- Adam D. Ruppe (7/11) Oct 01 2016 Not that I'm aware of.
- Jacob Carlborg (5/7) Oct 02 2016 I think it would be better to implement a parse function for
- kdevel (2/4) May 26 2017 You may invoke the compiler with TZ= prepended. (Linux)
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
Oct 01 2016
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 Andrewhttps://dlang.org/spec/lex.html#specialtokens
Oct 01 2016
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
Oct 01 2016
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:perfect, works a treat. Thanks both AndrewIs 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
Oct 01 2016
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:Has there been consideration for adding separate integral tokens for day, month, year, etc? The documentation there doesn't seem to specify but I assume currently the timestamps are for local time? 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, or if it was local that I'd at least want to be able to similarly retrieve the timezone info.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
Oct 01 2016
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 serious processing, but you can also slice the string up to do more with it.The documentation there doesn't seem to specify but I assume currently the timestamps are for local time?yeah/
Oct 01 2016
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
Oct 02 2016
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 locallyYou may invoke the compiler with TZ= prepended. (Linux)
May 26 2017