Date/time with sytem.date

Hi, if I want to create a date, I should use system.date.getDate. Is there a method that I can put in date & time? Best thing I have thought of is using system.date.add* Hours, Minutes, Seconds, and MIlls to my call of system.date.getDate.

Is there something easier I am missing?

Thanks

What kind of date do you want?
There is also system.date.now() that gets the now with date and time.
Or toDate toDate - Ignition User Manual 8.1 - Ignition Documentation

If you want to keep the same style:
https://docs.inductiveautomation.com/display/DOC81/system.date.setTime

or you can use system.date.parse() and use a string (e.g. '2021-07-06 04:30:28')

2 Likes

Oh wow, I saw that in the documentation, and never read it, assuming it was something to use to set system time. Thanks a bunch!