I'm investigation a strange behaviour only happening once a year ( on the 31th of december)
We have three Ignition servers running at a customer, all three have been returning a strange date on the 31th of december in a mySQL database used to log data
the timestamp for the date is extracted using sytem.date.now,
system.date.format is used to format the date for the database
Ignition SCADA Version
Ignition version 8.1.29
Operating system : Linux
Timezone : Europe/Brussels
Source code used
def writeQuery_mysql(Variable_name):
Datetime = (system.date.format(system.date.now(),"YYYYMMddHHmmssSSS"))[0:19]
State = stateGantryMysql(Variable_name)
row = {"Dt": Datetime, "Variable_name": Variable_name, "State": State}
try:
if State != '':
system.db.runNamedQuery("logbook/rss_logbookmysql",row)
except:
pass
named query
INSERT INTO logboekmysql (Datetime, Variable_name, State) VALUES (:Dt, :Variable_name, :State);
Example of logged data
the data below has been logged on the 31th of december 2023
behaviour detected
the datetime returned on the 31 first of december 2023 has been logged one year in the future.
All logged records on other date times are correct. All other loggings ar correct
question
is it possible that system.date.now() is returining a wrong value on the 31th of december?