import locale as l
loc=l.getdefaultlocale()
print(loc[0])
if I run the above in script console it returns “en_GB”
But if I run the same on Change script on DateTimeInput component it returns “en_US”
session.props.locale is “en_GB”
import locale as l
loc=l.getdefaultlocale()
print(loc[0])
if I run the above in script console it returns “en_GB”
But if I run the same on Change script on DateTimeInput component it returns “en_US”
session.props.locale is “en_GB”
Perspective component scripts run in the gateway. Your gateway is using a different locale from your designer. In Perspective, you must always deliberately use the locale from your session properties. Also, you really should be using the Java ZoneId
class, not jython’s locale
module.
I’m sure there’s a JVM argument you could use. In the designer launcher settings:
https://docs.inductiveautomation.com/display/DOC81/Designer+Launcher
As an accident of history, if you’ve got Vision installed you can change the Timezone Behavior property and the designer will (upon the next restart) take the given timezone:
Thanks. The designer is taking the given time zone but the perspective components aren’t. It would be great if the locale of DateTimeInput component can change its locale to based on the locale of the Designer ie. session.props.locale