![]() |
Is date comparison possible?
I was wondering if it is possible to compare dates in two variables in NSIS? I have searched the manual, the web and this forum with no luck.
If I have the date in two variables, for example: ; The date of the file time ${GetTime} "$WINDIR\Explorer.exe" "C" $0 $1 $2 $3 $4 $5 $6 ; and the date now !define /date NOW "%H:%M:%S %d %b, %Y" Is is possible to compare these two to see if the date of file creation is within a certain number of days of the current date? Wisdom in this matter will be much appreciated. Kind Regards. |
Rather than using !define /date NOW "%H:%M:%S %d %b, %Y", use
!define /date Day "%d" !define /date Month "%m" !define /date Year "%Y" and then compare each value individually. Stu |
Quote:
When I needed to see if a file was older than some desired amount (eg, a backup was not current), I created a temp file and compared the dates of the temp file and the backup file. Don |
If you want to get the time span between current (system) time and the time the installer was build, you can use the time plugin.
code: |
Thanks guys, I managed to get it done using the Time plug-in.
|
| All times are GMT. The time now is 06:11. |
Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.