Skip to content
⌘ NSIS Forum Archive

NSIS Unix Epoch Time

3 posts

hutnut#

NSIS Unix Epoch Time

I'm trying to obtain the current time as seconds since the Unix Epoch (January 1 1970 00:00:00 GMT). This is a PHP implementation I'm trying to duplicate in NSIS. I believe the Window's OS calls define the Epoch differently. Any help? Tx.
Anders#
system::call *(&i16,l)i.s
system::call 'kernel32::GetLocalTime(isr0)'
IntOp $1 $0 + 16
system::call 'kernel32::SystemTimeToFileTime(ir0,ir1)'
system::call *$1(l.r1)
system::free $0
system::Int64Op $1 / 10000000
Pop $1
system::Int64Op $1 - 11644473600
Pop $1
DetailPrint $1 
I think that is correct. Change GetLocalTime to GetSystemTime for UTC...