Hi all
I've got a question. We are doing a website integration from an online form that has a date and time field passed through to a date and time field (set to timezone independent) in the CRM.
We are using the CRM REST builder to build the create request and when executing it seems fine. The only problem is that when for example I set the start date and time on the website form to
23/05/2018 9:00am
It passes through to the CRM as 22/05/2018 11:00pm. I understand CRM stores date and time as UTC but I would of expected setting the field as timezone independent would mean it would no longer convert the time to the user local time when viewing in the CRM. The code snippet the REST builder generates is:
startdateandtime = new Date("05/23/2018 09:00:00").toISOString();
But when viewing the CRM entity record it's set it to 22/05/2018 11:00pm. Any help would be greatly appreciated.
Kind regards
Mike
*This post is locked for comments
Thanks all,
Both solutions worked.
Hi,
please use this.
DateTime date2 = utcDate1.ToLocalTime();
Hi Mike,
Time-Zone Independent format saves in UTC on the backend without converting the time-zone.
Try changing the date field to UTC and post the UTC value to the date time field in Web API.
DateTime date = new DateTime(2018, 5, 23, 9, 0, 0).ToUniversalTime();
Hope this helps.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156