12-02-2020 03:22 AM
Hi all,
What is the best way to populate a peripheral variable with the current timestamp in UTC?
I've tried using now(), however I am not able to reconcile the fraction portion of the output (it seems to be 30 minutes off local time?).
Any ideas? This should be easy, the router is aware of the current time in UTC.
12-02-2020 05:19 AM
It'll return whatever time is on the Central Controllers. If it's off from where you need it to be, you can add or subtract hours and minutes and plug that into a PV
12-02-2020 05:26 AM
If now doesn't do it for you (and I would investigate why you say the time is 30 minutes off from what you expect, since that could give you bigger routing problems down the road), you could also concatenate the various hour/minute/second variables into what you need, but that seems like a lot more work.
12-03-2020 01:32 AM
I was hoping there was an easy way to do this without having to manually maintain it (considering daylight savings), something like nowUTC(), given that the Router is aware of the time in UTC (rttest -> status confirms this).
12-03-2020 03:06 PM
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide