utc time to local time
Posted: Mon Apr 13, 2015 6:47 pm
Is there a way to convert UTC datetime to local datetime?
Thank you!
Thank you!
Code: Select all
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|317955339
Comment=STRINGLIST
ContinueOnError=INTEGER|0
ExternalName=STRING|"Task1144"
Hide=INTEGER|0
ID=INTEGER|33281083
LogOnAsUser=INTEGER|1
Name=STRING|"JS script..."
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0
[Actions]
Action1=FOLDER
[Actions\Action1]
ActionID=STRING|"A_SCRIPT_JSSCRIPT"
Enabled=INTEGER|-1
Name=STRING|"JS script"
Params=FOLDER
[Actions\Action1\Params]
expandvars=STRING|"0"
line00000000=STRING|"d = new Date();"
line00000002=STRING|"logmessage('GMT offset= ' + d.getTimezoneOffset() + ' minutes');"
line00000004=STRING|"logmessage('****************');"
line00000006=STRING|"logmessage(d.toGMTString());"
line00000007=STRING|"logmessage(d.toString());"
line00000008=STRING|"logmessage(d.toLocaleString());"
line0000000A=STRING|"logmessage('****************');"
line0000000C=STRING|"d = new Date(2015, 4, 14, 9,0,0);"
line0000000D=STRING|"logmessage(d.toGMTString());"
line0000000E=STRING|"logmessage(d.toString());"
line0000000F=STRING|"logmessage(d.toLocaleString());"
linecount=STRING|"17"
savescript=STRING|"0"
Code: Select all
d = new Date();
logmessage('GMT offset= ' + d.getTimezoneOffset() + ' minutes');
logmessage('****************');
logmessage(d.toGMTString());
logmessage(d.toString());
logmessage(d.toLocaleString());
logmessage('****************');
d = new Date(2015, 4, 14, 9,0,0);
logmessage(d.toGMTString());
logmessage(d.toString());
logmessage(d.toLocaleString());