Date/Time fields in Microsoft Dynamics CRM 2015 Update 1 - CloudFronts

Date/Time fields in Microsoft Dynamics CRM 2015 Update 1

Posted On November 16, 2015 by Admin Posted in 

The Date and Time data type is used in many times such as Project Start Date, Project End Date, Date of Birth, anniversaries etc.

Before the Update, CRM stored all date and time values with the user’s local time zone information. This included User Local format.  The system converted the users’ local time zone to Coordinated Universal Time (UTC) for backend storage and then converted the date and time back to the local time zone for display on forms.

When Date and Time data type is selected you can select different Behaviour in CRM 2015 Update 1.

The need for such update is sometimes date only format caused confusion basically for Birthdays, anniversaries.  Users would sometimes see a different day displayed depending on their local time zone.

The different Behaviours available in CRM 2015 Update 1 are as follows

  1. User Local
  2. Date Only format always sets time to 12:00 am
  3. Time-Zone Independent format saves in UTC on the backend without converting the time-zone

1

This date/time behaviour are not present in On-premises installation.
 
1. User Local Behaviour
The field values are displayed in the current user’s local time.

The Format available for User Local Behaviour is Date Only and Date and Time.

2

 

Here Project Start Date field is set as User Local

3

 

You can change the custom entity field’s behaviour from the User Local to Date Only or to Time-Zone Independent.

Before changing the behaviour of date and time field, review all the dependencies, to ensure thet there are no issues as a result of changing  behaviour.

4

 
2. Date Only Behaviour
The field values are displayed without the time zone conversion. The time portion of the value is always 12:00AM. The date portion of the value is stored and retrieved as specified in the UI and Web services. The Date Only behaviour can’t be changed to other behaviour types, once it’s set.

The Format available for Date Only Behaviour is Date Only.

5

 
“Date of Birth” field is set to Date only field.
6

 
3. Time-Zone Independent behaviour

The Time-Zone Independent behaviour can’t be changed to other behaviour types, once it’s set. The concept of a time zone isn’t applicable to this behaviour. The field values are displayed without the time zone conversion. The date and time values are stored and retrieved as specified in the UI and Web services

The Format available for Time-Zone Independent Behaviour is Date Only and Date and Time.
7

 
“Project End Date” field is set to Time Zone Independent Behaviour
8

 

On change of behaviour effect on existing records

1. When Date of Birth field behaviour is changed to Date only:
9

 
The Date of Birth field shown here is 9/15/2015 as entered by the user. When this field is retrieved the date/time value returned will be 9/14/2015 06:30:00 PM. Thus the date of birth visible and retrieved is different. In the database UTC date/time is set but in UI it appears different. This value is when the behaviour is user Local behaviour.
10

 
Retrieve the value of the Date of Birth field and you will get 9/14/2015. Here the date/time value set will be 9/14/2015 12:00:00 AM. When the record was originally created the date entered was 9/15/2015 and I would have expected it to show as 9/15/2015. However, since the change has not been made to the existing records for this field in database, they are still stored in the original UTC format along with the time. It appears that the UTC date/time is picked and the time part is being set as 12:00:00 AM.

Thus before changing, make sure about the dependent fields.
 
2. When Date of Birth field behaviour is changed to Time Zone Independent
11

 
Here the date and time filed visible is 11/16/2015 8:00 AM. When you retrieve this field the value is 11/16/2015 2:30 AM. Thus the date of birth visible and retrieved is different. In the database UTC date/time is set but in UI it appears different. This value is when the behaviour is user Local behaviour.
12

 
Retrieve the value of the Date of Birth field and you will get 11/16/2015 2:30 AM. When the record was originally created the date entered was 11/16/2015 8:00 AM and I would have expected it to show as 11/16/2015 8:00 AM. When the field behaviour is changed to time zone independent the time is been changed and data stored in database is picked.

 


Share Story :

Secured By miniOrange