I have problem with date.
I have simple script:
import datetime t_stamp = datetime.datetime.now() print (t_stamp) # Run a query that will update the values of the row matching the id. query = "INSERT INTO [Ignition].[dbo].[Test] (t_stamp) VALUES (?)" args = [t_stamp] print (args) event.source.parent.getComponent('Popup Calendar').date = t_stamp system.db.runPrepUpdate(query, args) system.db.refresh(event.source.parent.getComponent('Table'), "data")**strong text**
This script adding t-stamp in to SQL database.
This is output from the script:
and it’s correct. However, when I qry sql it return this. where first column is just time saved by Ignition and on the right is current time stamp from SQL. As you can see there is 1 hour difference.
Did anybody faced similar problem?
Just to highlight SQL server time is the same as Ignition time.