Home > Mobile >  CRM365 doesn't convert to the local time only the date 1 October 1983 on the form
CRM365 doesn't convert to the local time only the date 1 October 1983 on the form

Time:09-27

We have the Datebirth field on Contact entity form. When a user picks the date 1 October 1983, the system automatically changes it to 30 September 1983. However, this kind of magic doesn't happen with other dates. The field behavior is User Local. Format is Date Only. Our timezone GTM 3. Crm converts it to GTM 0 on changing field value correctly. Also we cannot change the behavior.

What could be the mysticism of 10/1/1983?

CodePudding user response:

We’ve been analyzing this problem for 2 days. Finally we found the core of the problem. The issue is that Sep 30 1983 and Sep 30 1982 are dates of daylight-saving time (DTS).

For example, when the date 1 Oct 1983 00:00 is picked and saved into database (MS SQL Server), it will be converted to the Greenwich Mean Time 0 (GMT 0). In our case (GMT 3) the time must be 09/30/1983 21:00:00.

But an extra hour is subtracted in function [DB_name]/Programmability/Scalar-valued functions/fn_UTCToTzSpecificLocalTime, because on switching to winter time the clock is put back an hour. As a result, the time 09/30/1983 20:00:00 is saved in DB, instead of 09/30/1983 21:00:00.

Therefore, when crm displays the time 09/30/1983 20:00:00 on a form, it converts it to local time (adds 3 hours). This is why we see 09/30/1983 23:00:00.

We added 1 hour in DB to solve this problem.

  • Related