Hi! Is there a way to change the format of the timestamp provided by motion and contact sensors provided by Fibaro HC2?
Thanks in advance!
Hi! Is there a way to change the format of the timestamp provided by motion and contact sensors provided by Fibaro HC2?
Thanks in advance!
Yes. You can apply custom formats by using a MultiBinding. In the curly brackets, after the binding index number, add a colon followed by the desired time format. Any of the formats listed on the web pages linked below are supported.
For these screenshots, I applied a format of MM-dd-yy hh:mm:ss
to the control. 1:
precedes that value because LastContact
is the second parameter in my Bindings list. If it was the first parameter it would be 0:MM-dd-yy hh:mm:ss
.
Hi Bill, thanks for the answer! Worked perfectly and goes to show again how awesome and customizable THR is if you know how to use it. Thanks again!
I have one additional question though. Is there a way I can force the time to be displayed in local time zone instead of UTC? And maybe even use the data to calculate x min ago or x hours ago?
Can you try removing your custom format & see if it displays in local time? I’m not certain, but it looks like it might be using UTC time when you apply a custom format.
I thought about instead of a time stamp using X min ago or X hours ago but decided to just use a standard date for now. Perhaps in the future in can be changed to something like that.
Yes, local time is displayed if the custom format is removed. I tried a bunch of different specifiers from the resources you already provided, but failed to get the local time showing. Hoping I just couldn’t find the correct one.
This will be fixed in the next release 3.19.0.0. Yeah, UTC time is currently being used on all custom formats.