Personalized Community is here!
Quickly customize your community to find the content you seek.
Choose your path Increase your proficiency with the Dynamics 365 applications that you already use and learn more about the apps that interest you. Up your game with a learning path tailored to today's Dynamics 365 masterminds and designed to prepare you for industry-recognized Microsoft certifications.
Visit Microsoft Learn
2020 Release Wave 2Discover the latest updates and new features to Dynamics 365 planned through March 2021.
Release overview guides and videos Release Plan | Preview 2020 Release Wave 2 TimelineWatch the 2020 Release Wave 2 virtual launch event
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Upcoming TechTalks
I am able to read the value but it is not exactly same what I can see in CRM.Date t
In CRM Form, selected value is: 11 Nov 2020 8:00am
How do i make JS read write value
Depending on exactly what you are wanting to do the answer may be slightly different, and the methods may be different, but on a Date object .toLocaleDateString() or .toLocaleDateString("<country code>") if you want it in a specific country timezone etc (also a similar method exists exists for the time component).
You can use getTimeZoneOffsetMinutes function from global context as below to get the correct date and time value.
var dateTimeFieldValue = Xrm.Page.getAttribute("FieldName").getValue()
var utcDate = new Date(dateTimeFieldValue.getUTCFullYear() , dateTimeFieldValue.getUTCMonth() , dateTimeFieldValue.getUTCDate(), dateTimeFieldValue.getUTCHours(), dateTimeFieldValue.getUTCMinutes(), dateTimeFieldValue.getUTCSeconds() ,dateTimeFieldValue.getUTCMilliseconds());
var correctFieldDateTimeValue = new Date(utcDate.setMinutes(utcDate.getMinutes() + Xrm.Utility.getGlobalContext().userSettings.getTimeZoneOffsetMinutes()));
Hope this helps!
Business Applications communities