Date and Time field’s Time-Zone behavior in D365

In most cases, customizers/administrators leave the Date & Time field as Local without paying much attention to detail.

types

With involvement of time, there are 2 behaviors while creating the field (or changing them, but there’s a catch)

You can change from Local to Time-Zone Independent any time, but can’t change from Time-Zone Independent to User Local once saved this way.
cantChangeBehavior

User Local

The Date & Time displayed in this field will be converted to the time-zone you are situated in.

localTime

Let’s say, the Date & Time is stored in UTC behind the scenes was 25th June 2019 6.30 PM, so whatever was stored, it will be converted to your System User’s local time according to the Settings. See below –

myTimeZone.png

Time-Zone Independent

This type of Date & Time of field, the time is stored in UTC, regardless of where you are located in the world.

timeZoneInd

If it is 6.30 PM on 25th June in UTC, it will be 12 AM in India on 26th June

 

It’s pretty basic, but needs to be done carefully!

Hope this helps.

13 thoughts on “Date and Time field’s Time-Zone behavior in D365

  1. It seems that Microsoft should allow you to set the time format in the display to allow Timezone to be included. This way when you enter your time – the format is reminding the user what they are entering. This is an easy way to help to make sure mistakes are not made.

    • Agreed. This has always been the issue in assuming what time is being shown. We have to remind ourselves what timezone we are in. Great point!

  2. Hi Priyesh,

    Quick question. How can I set the Time Zone globally for the entire tenancy apart from providing the user access to change their timezone through the Personalization settings?

  3. This works for users logging in via Dynamics 365… but what about Portal users who login as a contact via the Portal. How is TimeZone calculated for them (since they don’t have “Personal Options”)?

      • Interesting. So, internally, it is configured through Personal Options (which is per user), while on the Portal it is configured via site settings, which is PER SITE. Seems like it could cause some issues for those that need to worry about it. I’m inclined to just set both to User Local (take the default); I can’t come up with any Use Case for Time Zone Independent short of everyone just wanting to see Date/Time in UTC.

      • Yes, it’s a grey area which is often debated a lot and developers are left in a puzzle. I guess the best use case is to set to UTC and mention that the time is in UTC. 🙂

  4. Hello! I updated a field to be time zone independent and now I need to revert it back. I attempted to import a new unmanaged solution with the unchanged field in it, but with no luck – any thoughts? It is an msdyn_ field so I can’t simply delete and recreate it.

Leave a Reply