Fix Microsoft CRM PCF Date and Time Field Time Zone Display Issues
Question details
The user needs to resolve an issue where two different PowerApps Component Framework (PCF) controls display inconsistent dates for the same time-zone-independent field.

- Product
- Microsoft CRM
- Device & OS
- not provided
- Scenario
- Developing or implementing custom PCF controls that retrieve and pass date and time parameters from Dataverse.
- Observed behavior
- One PCF control displays April 30, while another displays May 1 for the database value 2023-04-30T21:44:03Z, pointing to inconsistent UTC parsing or unwanted local time conversion.
Ensure you have system customizer privileges in Dynamics 365/Microsoft CRM to inspect Dataverse field behaviors and access the source code for your PCF controls.
Standardize UTC Parsing in PCF JavaScript Logic
Prevent the native JavaScript Date object from automatically converting UTC timestamps to the browser's local time zone by explicitly handling the UTC values.
When a time-zone-independent field is passed to a PCF control, the raw value is often formatted in ISO 8601 (e.g., ending with 'Z' for UTC). If the receiving control uses the standard JavaScript Date object without explicit UTC methods, the browser applies the local time zone offset, causing the date to shift forward or backward.
Check the network tab in your browser's developer tools to verify the exact string value being returned by the CRM Web API before it reaches the PCF control.
Modify the control's code to use UTC-specific JavaScript methods such as getUTCDate(), getUTCMonth(), and getUTCFullYear() instead of standard local date methods.
Ensure that parameters passed between the two PCF controls are correctly normalized as explicit UTC strings to prevent the second control from treating the value as a local string.

Verify Dataverse Field Metadata Configurations
Confirm that the source field in Microsoft CRM is properly configured as Time zone independent and shares the same logic across both controls.
Easily Manage Exported CRM Data with WPS Office
While WPS Office cannot directly alter Microsoft CRM PCF code, it is the perfect lightweight alternative for opening, analyzing, and formatting exported CRM reports. Enjoy full compatibility with Microsoft Excel formats without the high subscription costs.
- 1. Download the Software: Get the free WPS Office suite from the official website and install it on your device.
- 2. Open CRM Exports: Launch WPS Spreadsheet and seamlessly open your downloaded CRM data files natively.
- 3. Analyze Data: Utilize built-in pivot tables and formatting tools to review and adjust your date and time fields easily.

Frequently Asked Questions
Why does the JavaScript Date object alter my CRM dates?
By default, the native JavaScript Date object automatically converts UTC timestamps (which are standard in CRM database responses) into the user's local browser time zone. This offset can unintentionally shift the displayed date to the previous or next day depending on your location.
Will changing the user's CRM time zone fix this PCF control issue?
No. Changing the personal time zone settings within Microsoft CRM will not correct date conversion errors that are hardcoded or introduced dynamically by custom PCF logic or browser-side JavaScript parsing.
What is a Time-zone-independent field in Dynamics 365?
A time-zone-independent field is a specific configuration where date and time values are saved to the database and displayed exactly as entered. It intentionally prevents the system from automatically converting the value to UTC or adjusting it based on the user's local time zone.




