I’m about 4 days deep into Losant and am working through creating an event that updates with the last reported time from a Gauge Query. In the Comment Template, I write something along the lines of “The last activity was reported on {{data.lasttime}}”
But when I see the event update, I see that it is showing the date in UTC because I believe the data table works in UTC?
It might be painfully obvious, but is there any way I can have it converted to my own time zone? (EST)
Thanks! Loving the platform so far now that I’m getting used to it !
Welcome to the Losant Forums! Currently, the best way to do this in a workflow would be to use Moment.js in a Function Node for the conversion. A relevant forum post can be found here. We do have this functionality in our roadmap, and I will update you when it is released.
I was struggling with this recently, and will point out that using moment.js still doesn’t adjust for daylight savings time automatically, which seems useful whenever you’re trying to display accurate local time. Therefore, I ended up taking the approach described in this thread:
Here the UTC offset is determined by a small block of code in a Function node, which then feeds into Date/Time nodes that make the adjustment to the timestamp and do whatever formatting you want.