web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

DateTime fields timezone 1 day offset

(0) ShareShare
ReportReport
Posted on by 87

Hello,

I understand that any date and time field is stored in the database according to UTC timezone and on the user interface it is displayed in the user preferred time zone. How can I make sure that all date time fields only display the datetime in utc time (like the database) instead of converting it to the user time zone without having the user change their preferred time zone? I want to do this so that I fix the issue of users seeing the date being offset by 1 day from when it was actually stored in the database.

Thank you

I have the same question (0)
  • Anthony90288 Profile Picture
    87 on at
    RE: DateTime fields timezone 1 day offset

    Thanks Martin. I believe my best solution is to display the local time without conversion to UTC and show that to all users without applying their timezone offset. That is the ideal solution as all users will see the record's date and time based on the timezone of the user that created it.

  • Verified answer
    Martin Dráb Profile Picture
    235,968 Most Valuable Professional on at
    RE: DateTime fields timezone 1 day offset

    The default behaviour is not always what you need, but if you change it globally, you'll break all the other places, won't you?

    All times (and often days) in the whole system will be wrong, unless my current time has zero offset. For example, I choose that an order should be delivered in today at 9 PM, but the system will convert it to UTC and show that it should be delived tomorrow at 3 AM (because you don't want to change my timezone to UTC, therefore the offset of my timezone will be removed). Users would have to apply their offset to all values they see in the system, which sound ridiculous.

    I think you should focus on the one field that you have a problem with.

    Also, your solution won't work even for your scenario. If I create a user at 22/09/2022 1:00 AM, the UTC date will be 22/08 - exactly what you didn't want. Using UTC isn't the same thing as using the local time at the place of creation.

    If training users isn't sufficient, you may want to store the original timezone and display date/time in that timezone. For example, InventSite has a timezone which is than used when calculating delivery date and such things

    Or you may store the local time (e.g. 22/09/2022 at 5:00pm) without conversion to UTC and show it again without applying user's timezone offset). This can be done by setting Timezone Preference = No conversion on a datetime form control.

  • Anthony90288 Profile Picture
    87 on at
    RE: DateTime fields timezone 1 day offset

    Hi Martin,

    The reason I want to do this is for consistency reasons. For example, I insert a employee record now so his employment start date is 22/09/2022 at 5:00pm my time and stored in the database at 22/09/2022 2:00PM since it is UTC. For a user a in United States, it will be displayed as 22/08/2022 7:00am. Although the employee technically joined on the 9th and not the 8th. In order to remove this offset, I want the displayed date and time to basically read the same date stored in the database. Therefore, HR users can all have the same consistent data independent on their time zone.

  • Martin Dráb Profile Picture
    235,968 Most Valuable Professional on at
    RE: DateTime fields timezone 1 day offset

    Also, can you elaborate your problem, please? What is in database should be irrelevant to users. If I create a record now and it's another day in UTC, I'll never know, because the system will always present the value in my timezone. It'll never show me the date and time in UTC.

  • Martin Dráb Profile Picture
    235,968 Most Valuable Professional on at
    RE: DateTime fields timezone 1 day offset

    This looks impossible to me. Why don't you want to change users' timezone? Isn't it exactly what you need?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Sohaib Cheema Profile Picture

Sohaib Cheema 878 User Group Leader

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 681 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 496 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans