# Timezones and Expressions

**URL:** <https://forum.inductiveautomation.com/t/timezones-and-expressions/8657>\
**Category:** Ignition\
**Created:** [July 2, 2014, 2:54pm UTC](https://forum.inductiveautomation.com/t/timezones-and-expressions/8657 "2014-07-02T14:54:35Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![marioquark](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@marioquark](https://forum.inductiveautomation.com/u/marioquark)\
**Post date:** [July 2, 2014, 2:54pm UTC](https://forum.inductiveautomation.com/t/timezones-and-expressions/8657/1 "2014-07-02T14:54:35Z")

</div>

Any way to convert a Date to another, specifing a different timezone, using expressions?

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [July 2, 2014, 4:59pm UTC](https://forum.inductiveautomation.com/t/timezones-and-expressions/8657/2 "2014-07-02T16:59:20Z")

</div>

Is the [dateFormat](https://www.inductiveautomation.com/support/usermanuals/ignition/index.html?gen_date_and_time_dateformat.htm) expression not doing what you need?

---

<div class="post-metadata">

**Author:** ![marioquark](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@marioquark](https://forum.inductiveautomation.com/u/marioquark)\
**Post date:** [July 11, 2014, 2:13pm UTC](https://forum.inductiveautomation.com/t/timezones-and-expressions/8657/3 "2014-07-11T14:13:43Z")

</div>

Hi KathyApplebaum,  
when i say “convert” i mean to change the internal timezone to another, changing even the time.  
the dateFormat function only formats a date to show the internal timezone or not, but it does not accept a timezone to show the different time changing tz.

an example of what i need:  
A = new date like “2014-07-07 09:37:00” with TimeZone “Europe/Rome”  
print [i]changeTZ/i  
should give  
“2014-07-07 07:37:00 GMT”

this is for me the correct way to handle dates and times across clients and gateways placed in different world areas, is it?  
thank you

---

<div class="post-metadata">

**Author:** ![adamaustin](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@adamaustin](https://forum.inductiveautomation.com/u/adamaustin)\
**Post date:** [July 11, 2014, 2:24pm UTC](https://forum.inductiveautomation.com/t/timezones-and-expressions/8657/4 "2014-07-11T14:24:01Z")

</div>

You could try changing the client general section of the project properties:

![](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/2/c2f638c4ea77f77f9fb4ffd28a952f5149bac284.jpeg)

---

<div class="post-metadata">

**Author:** ![KathyApplebaum](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kathyapplebaum/32/7261_2.png) [@KathyApplebaum](https://forum.inductiveautomation.com/u/KathyApplebaum)\
**Post date:** [July 11, 2014, 2:32pm UTC](https://forum.inductiveautomation.com/t/timezones-and-expressions/8657/5 "2014-07-11T14:32:23Z")

</div>

Ah, I see now.

You can write a Python script to do this, and then call the script from the expression using runScript. I just checked in 7.7, and calling global scripts from an expression works great.

[edit] Posted just as Adam did. Sounds like his solution may be more what you want, anyway. 🙂

---

<div class="post-metadata">

**Author:** ![marioquark](https://avatars.discourse-cdn.com/v4/letter/m/22d042/32.png) [@marioquark](https://forum.inductiveautomation.com/u/marioquark)\
**Post date:** [July 16, 2014, 10:49am UTC](https://forum.inductiveautomation.com/t/timezones-and-expressions/8657/6 "2014-07-16T10:49:40Z")

</div>

General section of the project properties… this could be the answer! ![:thumb_left:](https://us1.discourse-cdn.com/inductiveautomation/original/1X/e26afb081ddde6df016df6ee49159cf56aaca688.gif ":thumb\_left:")  
Thank you!

---

<div class="post-metadata">

**Author:** ![Clayton.Balfour](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/clayton.balfour/32/3937_2.png) [@Clayton.Balfour](https://forum.inductiveautomation.com/u/Clayton.Balfour)\
**Post date:** [January 27, 2016, 1:34pm UTC](https://forum.inductiveautomation.com/t/timezones-and-expressions/8657/7 "2016-01-27T13:34:34Z")

</div>

This there any way to change the Client timezone dynamically from the client?

---

<div class="post-metadata">

**Author:** ![adamaustin](https://avatars.discourse-cdn.com/v4/letter/a/5f8ce5/32.png) [@adamaustin](https://forum.inductiveautomation.com/u/adamaustin)\
**Post date:** [January 27, 2016, 3:29pm UTC](https://forum.inductiveautomation.com/t/timezones-and-expressions/8657/8 "2016-01-27T15:29:57Z")

</div>

If you are trying to correct a UTC time in the client, you could try this expression:

```auto
dateArithmetic({[.]LastPollTime}, toInt(dateFormat(now(),"Z")) / 100, "hour")
```

where [LastPollTime] is the UTC time that needs correcting.

(tested using Ignition 7.6.x)
