Accurate conversion of time field values obtained by Dynamics CRM form Javascript

Source: Internet
Author: User

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.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.