![]() |
#1 |
Junior Member
Join Date: Mar 2007
Posts: 12
|
how to get the date and time?
Does NSIS have a way to get the current date and/or time? I want to create a file whose name includes the date plus time so other similar files doen't get overwritten. Or is there a "random" function so I can generate a unique name?
thanks |
![]() |
![]() |
![]() |
#2 |
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
![]() |
![]() |
![]() |
#3 | |
Junior Member
Join Date: Mar 2007
Posts: 12
|
![]() Quote:
Oops -- I'm too ignorant to use this! I added '!include "FileFunc.nsh"' (and the headerfile is being found ok) and copy-pasted the example code "${GetTime} "" "L" $0 $1 $2 $3 $4 $5 $6", but at compile time that's rejected with "Invalid command: ${GetTime}". (I tried both in a section by itself and in one of my sections.) Is there magic sauce which I'm missing? Last edited by anadem; 21st March 2007 at 18:59. |
|
![]() |
![]() |
![]() |
#4 |
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,343
|
To generate a random filename at runtime use GetTempFileName. To generate a random filename at compile time use !tempfile.
To generate a string including a date or time in compile time, use !define /date. code: NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
![]() |
![]() |
![]() |
#5 | |
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
Quote:
!insertmacro GetTime Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
|
![]() |
![]() |
![]() |
#6 | |
Junior Member
Join Date: Mar 2007
Posts: 12
|
![]() Quote:
|
|
![]() |
![]() |
![]() |
#7 | |
Junior Member
Join Date: Mar 2007
Posts: 12
|
Quote:
|
|
![]() |
![]() |
![]() |
#8 |
Junior Member
Join Date: Mar 2007
Posts: 12
|
Hmm ... stuck again!
How is "${GetTime}" used in an uninstall section? tia |
![]() |
![]() |
![]() |
#9 |
Forum King
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
|
!include FileFunc.nsh
!insertmacro un.GetTime ........ ${un.GetTime}.... Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS |
![]() |
![]() |
![]() |
#10 |
Junior Member
Join Date: Mar 2007
Posts: 12
|
thanks again!
|
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|