# Timezone, date picker problem

**URL:** <https://forum.inductiveautomation.com/t/timezone-date-picker-problem/114371>\
**Category:** Ignition\
**Created:** [March 6, 2026, 9:02pm UTC](https://forum.inductiveautomation.com/t/timezone-date-picker-problem/114371 "2026-03-06T21:02:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eugene49](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@Eugene49](https://forum.inductiveautomation.com/u/Eugene49)\
**Post date:** [March 6, 2026, 9:02pm UTC](https://forum.inductiveautomation.com/t/timezone-date-picker-problem/114371/1 "2026-03-06T21:02:12Z")

</div>

So database is in the cloud, in UTC timestamp.  
Gateway is also in the cloud, with UTC timezone.  
Whoever created the project, also configured to be UTC timezone.

The End User in on EST timezone.

I have records in database that I want to filter by datetime.

The date picker is headache. **Biggest headache of all time up to date.**

The date picker UI shows UTC.  
BUT date picker value is EST.

I have not sort the Ask,  
But essentially, I need to create a wrapper for date picker, so I can intialized it and also returns desired output timezone.

(1) first question:  
How can I get offset of EST? that will work all year round?  
right now, i get offset from session-device-offset. I want it to be independent of device timezone.

~~(2) this is where I need to learn java date object, system.date is acting strange.  
In perspective, system.date.now() returns EST. cool!  
system.date.Midnight() and system.date.setTime() return UTC~~

---

<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:** [March 7, 2026, 8:06pm UTC](https://forum.inductiveautomation.com/t/timezone-date-picker-problem/114371/2 "2026-03-07T20:06:00Z")

</div>

Start here, follow links:

> [@Timezone related issue](https://forum.inductiveautomation.com/t/timezone-related-issue/113694/2):
>
> Ignition's DateTime tags, and datetime values/timestamps throughout Ignition, use the java.util.Date data type. This type is fundamentally UTC. Any datetime parsing or printing automatically applies the JVM timezone. If your MES is supplying UTC timestamps as strings, they will be naïvely interpreted in the gateway's timezone. Then when displayed in a project/client configured to IST, that already wrong timestamp will be butchered further. As you already see. If you need to parse or string…

---

<div class="post-metadata">

**Author:** ![Eugene49](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@Eugene49](https://forum.inductiveautomation.com/u/Eugene49)\
**Post date:** [March 10, 2026, 1:46am UTC](https://forum.inductiveautomation.com/t/timezone-date-picker-problem/114371/3 "2026-03-10T01:46:37Z")

</div>

For record, education. Below is what I did. Please feel free to comment.

Again, gateway and project is on UTC timezone.  
But date picker is in Browser timezone.

When I **initialized date picker** using `system.date.now()` (which is in UTC), it doesn't work.  
I need to spoof it:

```python
	def convert_utc_to_browser_time(date, timezoneId):
		from java.time import Instant, ZoneId
		date_string = system.date.format(date, "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
		offset_min = ZoneId.of(timezoneId).getRules().getOffset(Instant.parse(date_string)).getTotalSeconds() // 60
		return system.date.addMinutes(date, offset_min)

	# usage
	params['initBrowserDatetime'] = convert_utc_to_browser_time(system.date.now(), self.session.props.device.timezone.id)

```

The **result of date picker** convert it back to UTC.  
Like so:

```python
	def convert_browser_time_to_utc(date, timezoneId):
		from java.time import Instant, ZoneId
		date_string = system.date.format(date, "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
		offset_min = ZoneId.of(timezoneId).getRules().getOffset(Instant.parse(date_string)).getTotalSeconds() // 60
		return system.date.addMinutes(date, offset_min*-1)

	if "java.util.Date" in str(type(currentValue.value)):		
		browser_tz = self.session.props.device.timezone.id
		browser_date = currentValue.value
		
		utc_date = convert_browser_time_to_utc(browser_date, browser_tz)

```

if Gateway happen to be in different timezone, I don't know if the above still works.

Another realization.  
Dates shown in custom property are browser offsets:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/5/555ec0692c34600c85b842321889f91a4de7207e.png)

Appreciate for any thoughts.

---

<div class="post-metadata">

**Author:** ![Eugene49](https://avatars.discourse-cdn.com/v4/letter/e/c6cbf5/32.png) [@Eugene49](https://forum.inductiveautomation.com/u/Eugene49)\
**Post date:** [March 10, 2026, 1:50am UTC](https://forum.inductiveautomation.com/t/timezone-date-picker-problem/114371/4 "2026-03-10T01:50:56Z")

</div>

Interrestingly, my **convert to utc midnight** does not work on the daylight saving day March 8.

I use this function to get Est Midnight (in UTC):

```python
	def convert_utc_to_est_midnight_inUtc(utc_date):
		from java.text import SimpleDateFormat
		from java.util import TimeZone, Calendar
		utc_string = system.date.format(utc_date, "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
		parser = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
		parser.setTimeZone(TimeZone.getTimeZone("UTC"))
		utcDate = parser.parse(utc_string)
		est_tz = TimeZone.getTimeZone("America/New_York")
		cal = Calendar.getInstance(est_tz)
		cal.setTime(utcDate)
		# set midnight in est
		cal.set(Calendar.HOUR_OF_DAY, 0)
		cal.set(Calendar.MINUTE, 0)
		cal.set(Calendar.SECOND, 0)
		cal.set(Calendar.MILLISECOND, 0)
		
		estMidnight_utc = cal.getTime()
		return estMidnight_utc

```

1am in date picker should return 5am UTC.  
5am in date picker should return 4am UTC.

Edit.  
On Second thought, I think it is correct.  
Midnight is Midnight.
