Skip to content
Go back

D365 - Date and Time Fields

Table of contents

Open Table of contents

Introduction

This article documents the usage and fundamental concepts of Date and Time fields in Dynamics CRM.

Basic Concepts

Dataverse stores all date and time values in the UTC time zone. When applications display values or process user inputs, Dataverse and model-driven apps can use the Format option to adjust according to the user’s time zone.

Creating a “Date and Time” Field

When creating a Date and Time field in an entity, you can choose the following formats: Date Only or Date and Time.

FormatDescription
Date OnlyDisplays only the date portion. The time value is stored in the system as 12:00 AM (00:00:00)
Date and TimeDisplays full date and time values

Select "Format" for Date and Time field

When creating a Date and Time field, the Advanced Options allow you to configure Time Zone Behavior. The available options vary depending on the selected format:

Time Zone BehaviorDescription
User LocalDefault. Adjusts values based on the user’s time zone
Time-Zone IndependentDisplays values without time zone conversion
Date OnlyNo time zone conversion. Unlike Time-Zone Independent, time is not stored (always saved as 12:00 AM (00:00:00))
Time Zone BehaviorDescription
User LocalDefault. Adjusts values based on the user’s time zone
Time-Zone IndependentDisplays values without time zone conversion

Note: After creation, both “Format” and “Time Zone Behavior” can still be modified in a solution.

Can “Format” and “Time Zone Behavior” Be Changed Later?

The following table summarizes whether existing fields allow changes:

Format & Time Zone BehaviorFormatTime Zone Behavior
Date Only - User LocalYesYes
Date Only - Time-Zone IndependentYesNo
Date Only - Date OnlyNoNo
Date and Time - User LocalYesYes
Date and Time - Time-Zone IndependentYesNo

How to Choose Time Zone Behavior?

OptionDescription
Time-Zone IndependentUse when time zone is irrelevant (e.g., hotel check-in, invoice payment). All users will see the same value regardless of time zone.
Date OnlyUse when only the date matters (e.g., birthdays, anniversaries). All users will see the same date value.

Notes

#Description
1“Date Only - Time-Zone Independent” and “Date Only - Date Only” behave similarly. If unsure whether time parts (HH:mm:ss) may be needed later, choose Date Only - Time-Zone Independent.
2Since User Local is the default, carefully consider requirements before choosing Date Only or Time-Zone Independent, otherwise users across time zones may see different dates due to ±8 hours conversion.

Small Experiment

In the Invoice entity, I added 5 “Date and Time” fields and tested how they are stored.

(1) Create Fields

Display NameSchema NameFormatTime Zone Behavior
D - User Localgdh_d_userlocalDate OnlyUser Local
D - TZ Independentgdh_d_tz_independentDate OnlyTime-Zone Independent
D - Dgdh_d_dDate OnlyDate Only
DT - User Localgdh_dt_userlocalDate and TimeUser Local
DT - TZ Independentgdh_dt_tz_independentDate and TimeTime-Zone Independent

5 Date and Time fields

(2) Enter Values in Form

In (GMT+08:00) Beijing time zone:

FieldValue
D - User Local2025-03-10
D - TZ Independent2025-03-12
D - D2025-03-14
DT - User Local2025-03-10 14:30
DT - TZ Independent2025-03-24 09:30

Assign values to Date and Time fields

(3) Check Database

Check database data

FieldEntered ValueStored Value
D - User Local2025-03-102025-03-09 16:00:00.000
D - TZ Independent2025-03-122025-03-12 00:00:00.000
D - D2025-03-142025-03-14 00:00:00.000
DT - User Local2025-03-10 14:302025-03-10 06:30:00.000
DT - TZ Independent2025-03-24 09:302025-03-24 09:30:00.000

Explanation:

(4) Different User View (Test06)

User Test06 (time zone (GMT+04:00) Baku) sees:

Test06 viewing data

Example: D - User Local stored as UTC 2025-03-10 06:30:00. Converted to (GMT+04:00) becomes 2025-03-10 10:30:00.

(5) Client API Access

Code samples showing getValue() differences for User Local vs Time-Zone Independent.

(6) Web API Access

Retrieving via Web API returns the same raw values as stored in the database.


Unsupported Query Operators

“Date Only” fields do not support operators like:

Example query results in error 2147779605 The operator is not valid or it is not supported.

Error example

How to Set User Time Zone

Settings → Personalization Settings → General Tab → Choose Time Zone

Set user time zone

References

  1. Create and edit Dataverse columns using Power Apps solution explorer (CN)
  2. Column Data Types (EN)

The End

Copyright Notice

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Please attribute the source, use non-commercially, and maintain the same license.


Share this post on:

Previous Post
D365 - In-App Notifications
Next Post
D365 - Currency Fields