Question on UTC time, different results in script console and script transform

Hello,

I need UTC time for certain activities. I don't understand why in script transform the same code gives different result than in script console?

Question also why did the formatting change the time?

In script cosole its looks correct and time have the same value:

Best regards
Michał

Why are you using import time instead of system.date | Ignition User Manual functions?

Be aware that the console is using your PC's clock whereas the bindings are using that of the gateway.

Every time you print a datetime object, print performs a string conversion for you. (Because print can't print binary objects.) The default string conversion uses the time zone of the JVM where the script is running. The designer is a separate JVM from the gateway, so differences are utterly normal.

See this entire topic to reset your paradigm:

(And don't use python's stdlib in jython where there are Java alternatives. Full stop.)