gpt4 book ai didi

c# - 从 Dynamics CRM API 返回什么 DateTime

转载 作者:太空狗 更新时间:2023-10-29 22:57:31 24 4
gpt4 key购买 nike

从 Dynamics CRM Web API 返回的 DateTime 对象是否始终采用 UTC 格式?记录在何处?

我正在使用 CRM SDK nuget 包。我在几个博客(通过 CRM 商店)上读到,CRM API 总是返回 UTC DateTime 对象,并且我经历过 DateTime.Kind 总是 UTC(根据我的测试),但我需要确定。

如果重要的话,CRM 是 2015 年的。

我正在使用以下代码调用 Dynamics CRM 网络服务。

 var querybyattribute = new QueryByAttribute()
{
EntityName = Opportunity.EntityLogicalName,
ColumnSet = new ColumnSet(true)//all columns
};

querybyattribute.Attributes.AddRange(attributeName);
querybyattribute.Values.AddRange(attributeValue);

然后调用RetreiveMultiple

EntityCollection entities;
using (var proxy = new ManagedTokenOrganizationServiceProxy(serviceManagement, credentials))
{
entities = proxy.RetrieveMultiple(query);
}

最佳答案

CRM 中的日期具有三种不同类型的行为。其中只有两个真正具有时区的概念。可以在 MSDN 上找到这三种类型的行为。 , 相关部分复制在这里:

UserLocal(这是 CRM 2015 更新 1 之前唯一可用的)

The retrieve operation returns the UTC value.

仅限日期

For the retrieve and update operations, no time zone conversion is performed, and the time value is always 12 AM (00:00:00).

TimeZoneIndependent

For the retrieve and update operations, no time zone conversion is performed, and actual date and time values are returned and updated respectively in the system regardless of the user time zone.

关于c# - 从 Dynamics CRM API 返回什么 DateTime,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38104793/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com