简体   繁体   English

如何使用odata和Javascript获取CRM 2011中的用户预览时间

[英]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

this link show how to solve this problem in C# but i want it using Javascript 该链接显示了如何在C#中解决此问题,但我希望使用Javascript来解决

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.

相关问题 如何在CRM 2011中使用Javascript和oData获取PartyList字段的值 - How to get value of PartyList field using Javascript and oData in CRM 2011 如何从CRM 2011 javascript odata函数返回数据? - How to return data from CRM 2011 javascript odata function? crm 2011 IFD无法使用OData和Javascript - crm 2011 IFD is not working using OData and Javascript 如何使用Javascript获取服务器版本CRM 2011或CRM 2013 - How to get Server Version CRM 2011 or CRM 2013 using Javascript 如何使用 CRM 2011 Web 服务和 JavaScript 在 CRM 2011 中执行 FetchXML? - How to Execute FetchXML in CRM 2011 using a CRM 2011 webservice and JavaScript? CRM 2011使用JavaScript从实体获取属性 - CRM 2011 Get attributes from an entity using JavaScript 在CRM 2011中使用OData检索多个 - Retrieve multiple using OData in CRM 2011 使用JavaScript和REST OData查询CRM 2011 AppointmentSet时如何测试d.data.results中存在哪些数据 - How to test what data is present in d.data.results when querying CRM 2011 AppointmentSet using JavaScript and REST OData 使用jQuery / javascript从CRM 2011中获取记录 - Fetching Record from CRM 2011 using jQuery/javascript CRM 2011如何使用Java来使用子/相关实体表单中的值更新父实体字段 - CRM 2011 how to update a Parent entity field with values from a child/related entity form using Javascript
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM