when i get date and time from odata query in Javascript web resource , it is get deferent from the value in witch is showing in crm form (DateTime filed)
i used this code to format datetime
function formatDate(dt) {
dt = dt.replace("/Date(", "");
dt = dt.replace(")/", "");
var date = new Date(parseInt(dt, 10));
return date;
}
http://charithrajapaksha.blogspot.com/2013/05/working-with-date-and-time-values-in.html
How can i solving this matter
Date Time in CRM is stored in UTC and that is why it's off. You'll need to convert your Date Time to the Date Time of the user. Here is how to convert it to the user's browser time .
I will caution you that ideally you should be looking up the user's actual time zone within CRM, but I'd imagine 95% of the time this should work fine.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.