i try use the function Date(),but MJS does not support.So I'd like to know how you implement the timeUnix conversion?
May be my expression is not clear enough, my question is, how to convert TimeUnix into standard time? example 2017-05-05 15：21
There are no JS functions currently for time formatting.
thank you ,so I can only write algorithm conversion, right?
We can add a `Timer.fmt()` function or similar, but I am hesitant.Not sure that the device side should do pretty-printing.
@liu , what do you mean algorithm conversion? Just use UNIX timestamps and add offset time based on your timezone.If you are logging the data to the server, I would recommend to just send UNIX timestamps and do all the conversions on the server end.
I bumped into this page looking for a solution -- here is how I solved it ... for future googlers.
let now = Timer.now();
let hour = ( 24 + Math.floor(now % 86400 / 3600 - 6)) % 24; // 6 for mountain time
let min = Math.floor(now % 3600 / 60) ;
let hhmm = hour + min / 100;
... giving you 13.50 number for 10 minutes to 2 PM in your timezone that a small device can display
or store in a more readable manner than 1539028200.