Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/date/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Date 从NSIS中的时间戳获取日期_Date_Timestamp_Nsis - Fatal编程技术网

Date 从NSIS中的时间戳获取日期

Date 从NSIS中的时间戳获取日期,date,timestamp,nsis,Date,Timestamp,Nsis,我是个新手,我正在尝试从给定的时间戳中获取日期、小时、分钟等 有什么办法吗 提前感谢您的回答…!包括LogicLib.nsh !include LogicLib.nsh Section StrCpy $0 1568807339 ; UNIX time System::Int64Op $0 * 10000000 System::Int64Op 116444736000000000 + ; support.microsoft.com/en-us/help/167296/how-to-convert-

我是个新手,我正在尝试从给定的时间戳中获取日期、小时、分钟等

有什么办法吗

提前感谢您的回答…

!包括LogicLib.nsh
!include LogicLib.nsh
Section
StrCpy $0 1568807339 ; UNIX time
System::Int64Op $0 * 10000000
System::Int64Op 116444736000000000 + ; support.microsoft.com/en-us/help/167296/how-to-convert-a-unix-time-t-to-a-win32-filetime-or-systemtime
System::Call 'KERNEL32::FileTimeToLocalFileTime(*ls,*l.s)' ; This line is optional, comment it out if you want to keep it UTC
System::Call 'KERNEL32::FileTimeToSystemTime(*ls,@r0)i.r1' ; NSIS v3+
${If} $1 <> 0
    System::Call '*$0(&i2.r1,&i2.r2,&i2,&i2.r3,&i2.r4,&i2.r5,&i2.r6)'
    IntFmt $2 "%.2d" $2
    IntFmt $3 "%.2d" $3
    IntFmt $4 "%.2d" $4
    IntFmt $5 "%.2d" $5
    IntFmt $6 "%.2d" $6
    DetailPrint "$1/$2/$3 $4:$5:$6"

    System::Call 'KERNEL32::GetDateFormat(i0x0400,i0,pr0,p0,t.r1,i666)'
    System::Call 'KERNEL32::GetTimeFormat(i0x0400,i0,pr0,p0,t.r2,i666)'
    DetailPrint "$1 $2"
${EndIf}
SectionEnd
部分 StrCpy$0 1568807339;UNIX时间 系统::Int64Op$0*10000000 系统::Int64Op 1164444736000000000+;support.microsoft.com/en-us/help/167296/how-to-convert-a-unix-time-t-to-a-win32-filetime-or-systemtime System::调用'KERNEL32::FileTimeToLocalFileTime(*ls,*l.s)';这一行是可选的,如果您想保留它,请将其注释掉 系统::调用'KERNEL32::FileTimeToSystemTime(*ls,@r0)i.r1';NSIS v3+ ${If}$1 0 系统::调用“*$0(&i2.r1,&i2.r2,&i2.r3,&i2.r4,&i2.r5,&i2.r6)” IntFmt$2“%.2d”$2 IntFmt$3“%.2d”$3 IntFmt$4“%.2d”$4 IntFmt$5“%.2d”$5 IntFmt$6“%.2d”$6 详细打印“$1/$2/$3$4:$5:$6” 系统::调用'KERNEL32::GetDateFormat(i0x0400,i0,pr0,p0,t.r1,i666)' 系统::调用'KERNEL32::GetTimeFormat(i0x0400,i0,pr0,p0,t.r2,i666)' 详情打印“$1$2” ${EndIf} 分段结束
什么样的时间戳?32位unix时间(秒)?Windows FILETIME?它是标准的Unix时间戳,比如1568807339太棒了!非常感谢你!