[英]How to Get user preview time in CRM 2011 from using odata ,Javascript
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) 当我从Javascript Web资源中的odata查询中获取日期和时间时,它与crm格式中显示的女巫中的值有所不同(DateTime归档)
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 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. CRM中的日期时间存储在UTC中,这就是为什么关闭它的原因。 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. 我会警告您,理想情况下,您应该在CRM中查找用户的实际时区,但是我认为95%的时间应该可以正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.