I’m trying to get a UTC Timestamp that I can use for Inserting into a MySQL Table in a DateTime Field.
I’m using the system.tag.read function to get the value of a tag. I was then using the .timestamp field to get the timestamp of the tag and then using the system.db.dateFormat() to format the timestamp properly in the Datetime Field. I’m timestamping down to Milliseconds and was using the following formatting “yyyy-MM-dd HH:mm:ss:SSSZ” However this produces the correct formatting but the Field comes out with a -700 at the end which is an offset from GMT if I’m not mistaken taking into account daylight savings time. Of course this makes my INSERT Fail into MySQL.
Is there a function in Java or Python that I can use that will put out a UTC time already taking into account the local computer time without the -700. I could then use the system.db.dateFormat() to put it in the correct formatting to insert in the Table.
Thanks for the help.