Beno
March 25, 2023, 3:16pm
2
Hi Babu. Welcome to the Opto forums.
Here are a few search results that might help answer your question (to be clear, I’m not exactly sure what your ‘time’ question is, so feel free to review these suggestions and if none of them are quite right, please ask more questions to help us help you)…
Like most microcontrollers / PLC’s, the PAC Controller uses a real time chip for its date/time functions.
That chip will have some drift in its accuracy due to lots of reasons, not the least of which is temperature.
Thus, over time, the clock will be off by some amount.
If you are running PAC Display all the time, there is an option under the ‘Configure’ -> ‘Runtime’ -> ‘Control Engine’ tab to allow you to synchronize the control engine clock with the PC clock every day or so.
Also, when you…
The Unix epoch / “unix time” is the number of seconds that have passed since January 1st, 1970 (counting leap years, but not counting leap seconds). Many software systems rely on the unix time standard as consistent and predictable way of calculating, storing, and sharing the date and time.
For example, databases will often use unix time to keep track of when entries are inserted into the database. It’s also in the Sparkplug B specification for MQTT, is used a lot in Node-RED, and thousands of …
There are many options for date formatting in JavaScript, among which are
toString() which results in “Tue Jul 18 2017 13:28:48 GMT-0700 (PDT)”,
toUTCString() that gives “Tue, 18 Jul 2017 20:28:48 GMT”,
and finally toISOString() for “2017-07-18T20:28:48.297Z”, as well as methods that return each piece with getFullYear()_, getHours(), getMilliseconds(), etc. (see full list) .
None of these, however, provide 12 hour time or AM / PM status, which is usually easier to actually read. In order to g…