0

We have an on premise tenant and using unified interface. I have a form which has a date field and its behaviour is set as User Local.

enter image description here

Date Field Setting On the same form I have a web resource that displays the same date field data on form load. I am using parent.Xrm.Page.getAttribute("fieldname").getValue() to get the date field value on web resource.

I know the date is getting stored in UTC format. It displays fine on the form but on the web resource it is one day behind.

Is it the timing issue that form has got the date in UTC format but before it converts it to local format, web resource reads it.

Please advise.

DeC
  • 2,226
  • 22
  • 42
  • I'm unable to reproduce this issue. any detailed repro steps, snippet & output in browser console or debug can be shared here? – Arun Vinoth-Precog Tech - MVP Nov 19 '19 at 21:12
  • This is the problem, it does not always happens. Every now and then users are complaining about this. – u981157 Nov 20 '19 at 01:33
  • then you really have to change that into timezone independent behavior.. a date is a date.. :) – Arun Vinoth-Precog Tech - MVP Nov 20 '19 at 01:35
  • @ArunVinoth This is the problem, it does not always happen. Every now and then users are complaining about this. If someone can explain how the form load happens then I can try to figure out how to solve this. My observation is when form loads it gets the date field as UTC and then converts it to local user settings but before it converts it webresource reads the value and hence displaying the UTC date. – u981157 Nov 20 '19 at 01:39
  • I don’t think your code executed faster than the platform code.. there should be a pattern of time window, repeat user seeing issues, personal settings, etc which will help.. https://learn.microsoft.com/en-us/powerapps/maker/portals/configure/behavior-format-date-time-field – Arun Vinoth-Precog Tech - MVP Nov 20 '19 at 01:49
  • I have found the issue. If the time zone in CRM personal setting is different than the time zone setting of the machine then this problem happens. In my case CRM personal setting had Sydney as the time zone but machine was set for Brisbane time zone. – u981157 Nov 20 '19 at 07:23
  • Pls post it as answer & close this question – Arun Vinoth-Precog Tech - MVP Nov 20 '19 at 14:42

1 Answers1

0

I have found the issue. If the time zone in CRM personal setting is different than the time zone setting of the machine then this problem happens. In my case CRM personal setting had Sydney as the time zone but machine was set for Brisbane time zone. –I