kook04
30th April 2008 18:46 UTC
Getting "today's" date dynamically
I currently define a variable in my script that is the date of the software build. Right now I have to manually change this line every time I do a release build. This line looks like this:
!define SOFTWARE_VERSION "April 22nd, 2008"
Is there some way in NSIS to get the current date (formatted preferably) dynamically? It would be much better if I didn't have to change this line ever again :)
Thanks,
Kennedy
Dsstrainer
30th April 2008 19:34 UTC
You could use ${__DATE__} in the script
kook04
30th April 2008 20:17 UTC
That works well. Thank you for your help.
{_trueparuex^}
30th April 2008 21:43 UTC
You can also define date with your own format...
!define /date MYDATE "%b %dnd, %Y"
${MYDATE} = "April 30nd, 2008"
See strftime at MSDN for all symbols.
http://msdn.microsoft.com/en-us/libr...ak(VS.71).aspx
Dsstrainer
1st May 2008 13:18 UTC
ahh.. thank you! I understand now about installer time vs run time... tho it wasn't quite clear from the F1 help file