$systemtime = "2016/11/01"
不好意思, 我忘記我的日期抓到的會是這樣的格式
201611011723
年月日時分
...
ipmitool 发表于 2016-11-1 09:35
用正则替换:
#include <Date.au3>
$aaa = "201611011723";结束日期
Local $sNe = StringTrimRight($aaa, 4)
Local $Riqi = StringMid($sNe, 1, 4) & "/" & StringMid($sNe, 5, 2) & "/" & StringMid($sNe, 7, 2)
;$systemtime = "2016/11/01";结束日期
$123 = _DateDiff('D', $Riqi, _NowCalc())
Local $sString = StringTrimLeft($123, 1) ; 删除字符串左起 1 个字符.
If $systemtime >= $sString Then
MsgBox(0, "1", $sString)
Else
MsgBox(0, "2", "Over " & $sString & " days")
EndIf
|