Accurate conversion of time field values obtained by Dynamics CRM form Javascript
This article continues the previous blog article to continue the time field conversion experiment. This article describes how to obtain and update the time field in the form Javascript, and whether the conversion in time is required, first look at the time field value obtained through ODATA
Of course, you can see that the format cannot be used directly. You need to convert the format as follows:
Date = date. replace (/Date (,); date = date. replace ()/,); dateValue = new Date (parseInt (date, 10 ));
We can see that the obtained time is the accurate time displayed on the interface and does not need to be converted.
Even if the time display format on the interface is 12 hours, the time after format conversion is 24 hours.
After verifying the query, we continue to verify the update.
We can directly obtain the current time and assign values.
After the update, it is found that the time of the form displays the correct current time. Therefore, no time conversion is required for obtaining and updating the time in the Form script. In the future, we will continue the experiment to determine whether to convert the acquisition and update time in plugin. It takes a long time for me to encounter a bug episode during the experiment in this example, and I will provide a separate description later.