My clients are asking me to log start - stop - aborted times of sequences in ignition.
I want to run a script on a “tag change” in the gateway for now im testing it with scripting behind a button.
Everything seems to be working except i want to have it ordered by time. There are two ways to do this using the gateway time script or the CURRENT_TIMESTAMP in SQL query.
Here is my current update.
query = “INSERT INTO Logging (Nummer, Object_Name, Object_Type, Streng, Start_Time) VALUES (?,?,?,?,current_timestamp)”
args = [Nummer, Object_Name, Object_Type, Streng,]
The problem is that both of these use a wrong format so when I sort it doesnt sort correctly because it uses AM and PM.
I want the format YY-MM-DD-HH-MM-SS. Is it possible to reformat the DateTime tag from ignition to get this format or if any1 has another SQL command that makes the timestamp in this format that would be great!
Thanks in advance!