Hello
I am trying to get just the hour for current time using Timer.fmt(). However, the following code:
let unixtime = Timer.now();
let timestamp = Timer.fmt("%Y-%m-%d %H:%M:%S", localTIME.unixtime);
print('++++', JSON.stringify({Weather: unixtime}));
print('++++', JSON.stringify({Weather: timestamp}));
let yearStr = Timer.fmt("%Y", unixtime);
print('++++', JSON.stringify({Year: yearStr}));
print("yearStr: ",yearStr);
Produes:
[Jun 4 18:08:07.046] ++++ {"Weather":1559671686.260598}
[Jun 4 18:08:07.078] ++++ {"Weather":"2019-06-04 18:08:06"}
[Jun 4 18:08:07.111] ++++ {"Year":" "}
[Jun 4 18:08:07.111] yearStr:
Am I doing something wrong? Thanks.