GetTime updates by Instructor

- Added support for system time (UTC)
- Added example how to convert time to 12-hour format AM/PM


git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4456 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
kichik 2005-12-24 15:47:32 +00:00
parent ba9866b2bf
commit 245caeecc0
2 changed files with 68 additions and 8 deletions

View file

@ -1,7 +1,7 @@
/*
_____________________________________________________________________________
File Functions Header v2.7
File Functions Header v2.9
_____________________________________________________________________________
2005 Shengalts Aleksander aka Instructor (Shengalts@mail.ru)
@ -1070,6 +1070,10 @@ RefreshShellIcons
StrCmp $1 'A' getfile
StrCmp $1 'C' getfile
StrCmp $1 'M' getfile
StrCmp $1 'LS' gettime
StrCmp $1 'AS' getfile
StrCmp $1 'CS' getfile
StrCmp $1 'MS' getfile
goto error
getfile:
@ -1080,19 +1084,36 @@ RefreshShellIcons
gettime:
System::Call '*(&i2,&i2,&i2,&i2,&i2,&i2,&i2,&i2) i .r7'
StrCmp $1 'L' 0 filetime
StrCmp $1 'L' 0 systemtime
System::Call 'kernel32::GetLocalTime(i)i(r7)'
goto convert
systemtime:
StrCmp $1 'LS' 0 filetime
System::Call 'kernel32::GetSystemTime(i)i(r7)'
goto convert
filetime:
System::Call '*$6(i,l,l,l,i,i,i,i,&t260,&t14)i(,.r4,.r3,.r2)'
System::Free $6
StrCmp $1 'A' 0 +3
StrCpy $2 $3
goto +3
StrCmp $1 'C' 0 +2
goto tolocal
StrCmp $1 'C' 0 +3
StrCpy $2 $4
goto tolocal
StrCmp $1 'M' tolocal
StrCmp $1 'AS' tosystem
StrCmp $1 'CS' 0 +3
StrCpy $3 $4
goto tosystem
StrCmp $1 'MS' 0 +3
StrCpy $3 $2
goto tosystem
tolocal:
System::Call 'kernel32::FileTimeToLocalFileTime(*l,*l)i(r2,.r3)'
tosystem:
System::Call 'kernel32::FileTimeToSystemTime(*l,i)i(r3,r7)'
convert: