# Returning different at Locale script console and perspective component

**URL:** <https://forum.inductiveautomation.com/t/returning-different-at-locale-script-console-and-perspective-component/56563>\
**Category:** Ignition\
**Tags:** perspective, ignition81, scripting\
**Created:** [February 25, 2022, 1:02pm UTC](https://forum.inductiveautomation.com/t/returning-different-at-locale-script-console-and-perspective-component/56563 "2022-02-25T13:02:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![user66](https://avatars.discourse-cdn.com/v4/letter/u/b487fb/32.png) [@user66](https://forum.inductiveautomation.com/u/user66)\
**Post date:** [February 25, 2022, 1:02pm UTC](https://forum.inductiveautomation.com/t/returning-different-at-locale-script-console-and-perspective-component/56563/1 "2022-02-25T13:02:50Z")

</div>

_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”

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 25, 2022, 2:38pm UTC](https://forum.inductiveautomation.com/t/returning-different-at-locale-script-console-and-perspective-component/56563/2 "2022-02-25T14:38:00Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![user66](https://avatars.discourse-cdn.com/v4/letter/u/b487fb/32.png) [@user66](https://forum.inductiveautomation.com/u/user66)\
**Post date:** [February 25, 2022, 3:55pm UTC](https://forum.inductiveautomation.com/t/returning-different-at-locale-script-console-and-perspective-component/56563/3 "2022-02-25T15:55:12Z")

</div>

@pturmel okay. Thanks for that 👍. Is it possible to change the designers locale?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 25, 2022, 3:57pm UTC](https://forum.inductiveautomation.com/t/returning-different-at-locale-script-console-and-perspective-component/56563/4 "2022-02-25T15:57:59Z")

</div>

I’m sure there’s a JVM argument you could use. In the designer launcher settings:

[https://docs.inductiveautomation.com/display/DOC81/Designer+Launcher](https://docs.inductiveautomation.com/display/DOC81/Designer+Launcher)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [February 25, 2022, 4:22pm UTC](https://forum.inductiveautomation.com/t/returning-different-at-locale-script-console-and-perspective-component/56563/5 "2022-02-25T16:22:48Z")

</div>

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:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/3/13c0e95f37e4504a57ed353233ed1fee9ab404cf.png)

---

<div class="post-metadata">

**Author:** ![user66](https://avatars.discourse-cdn.com/v4/letter/u/b487fb/32.png) [@user66](https://forum.inductiveautomation.com/u/user66)\
**Post date:** [February 25, 2022, 4:40pm UTC](https://forum.inductiveautomation.com/t/returning-different-at-locale-script-console-and-perspective-component/56563/6 "2022-02-25T16:40:54Z")

</div>

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
