# DateTime component not displaying the correct date after selection

**URL:** <https://forum.inductiveautomation.com/t/datetime-component-not-displaying-the-correct-date-after-selection/62541>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [August 1, 2022, 12:27pm UTC](https://forum.inductiveautomation.com/t/datetime-component-not-displaying-the-correct-date-after-selection/62541 "2022-08-01T12:27:19Z")\
**Posts on this page:** 4\
**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:** [August 1, 2022, 12:27pm UTC](https://forum.inductiveautomation.com/t/datetime-component-not-displaying-the-correct-date-after-selection/62541/1 "2022-08-01T12:27:20Z")

</div>

I have a situation where the _timeZoneId_ in session props and _device/timeZone/Id_ in session props are different. What decides the timeZoneId in session props?

Hence, when I click a date in the dateTime component the previous day’s date gets selected.  
Is there any way to overcome this?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [August 1, 2022, 1:44pm UTC](https://forum.inductiveautomation.com/t/datetime-component-not-displaying-the-correct-date-after-selection/62541/2 "2022-08-01T13:44:48Z")

</div>

The Designer decides the `timeZoneId` value, and thus can sort of force sessions into behaving as if they were all using a specific timezone. However, we have no control over the true timezone of a device, and so `device.timeZone.id` should be understood as a read-only property to give you insight into what timezone the user is actually in. So there should be no interference in the properties. If you are having trouble with dates, you either need to allow a user to select a different day and account for the tie difference, or you need to force their session into using a certain timezone.

---

<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:** [August 2, 2022, 5:15am UTC](https://forum.inductiveautomation.com/t/datetime-component-not-displaying-the-correct-date-after-selection/62541/3 "2022-08-02T05:15:50Z")

</div>

> [@cmallonee](#):
>
> you need to force their session into using a certain timezone.

How can this be achieved?

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [August 2, 2022, 11:07am UTC](https://forum.inductiveautomation.com/t/datetime-component-not-displaying-the-correct-date-after-selection/62541/4 "2022-08-02T11:07:16Z")

</div>

By setting the session timezone to a value of your choosing.
