I’ve got an application I’m working on that is going to be used as a time clock style application.
The data will be stored in an existing MSSQL server. The appropriate columns are set for the datetime2 data type currently.
The gateway and SQL server will be located in the same time zone EST or America\New York
Basically I want to make sure that I’m inserting the proper time into the tables so that DST doesn’t screw with them.
Is logging the system.date.now() value from Ignition sufficient to avoid any DST issues or should I have MSSQL log the UTC time based on when the insert occurs?
If I log the UTC value, how do I get it back out and convert it to local time properly to display it? In my playing around, if I do a SQL insert with the getutcdate() function, the UTC date/time is stored in SQL however when I go an read it from the Ignition side the time doesn’t get offset down to the local time zone. Date/Time stuff isn’t my forte by any means, so I’m most definitely doing something wrong with this
Thanks for the help