Dynamics CRM - 夏令时

发布于 2024-11-01 09:44:01 字数 209 浏览 0 评论 0原文

爱尔兰于 3 月 27 日开始实行夏令时。从那时起,添加到 Dynamics 的任何记录的任何日期字段都设置为比实际添加时间晚一小时。

奇怪的是,Web UI 正确返回日期,而使用 SQL Server 和 XRM 查询则错误返回日期。

服务器计算机上的时间设置正确,我已经安装了 rollup 16,还有什么我可以尝试的吗?

谢谢,

大卫

Daylight savings time kicked in on March 27 in Ireland. Since then any records that have been added to Dynamics have had any date fields set to an hour behind the actual time they were added.

What's weird is that the web UI returns the dates correctly, whereas querying using SQL server and XRM return them incorrectly.

The time settings on the server machine are correct, I've installed rollup 16, is there anything else I can try?

Thanks,

David

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

只是我以为 2024-11-08 09:44:01

Dynamics CRM 以 UTC 格式存储所有日期时间值。

通过 Web 前端输入的所有数据在存储时都会自动转换为 UTC,在读取时会自动转换回用户时区。

如果您使用 Dynamics CRM Outlook 客户端,则使用 Windows 的时区设置。如果您使用网络客户端,它将使用您个人选项中的时区设置。确保它是正确的。

SDK

SDK 始终使用 UTC 日期,并且以任何方式转换它们。您有责任以适当的方式转换数据。但是, CrmDateTime 类包含一些有用的方法和的属性。

报告

确保您仅访问 FilteredViews (例如 FilteredAccount,这是数据库唯一受支持的用途)。日期字段会自动转换为正确的时区(根据用户设置)。如果您需要访问原始值,可以将其作为带有 utc 后缀的列(createdon ->createdonutc)。要根据用户/系统设置格式化日期值,您也可以在报告中访问这些设置。请参阅“设置内容格式

Dynamics CRM stores all date time values in UTC-Format.

All data which is entered with the web front-end gets automatically converted to UTC when stored and converted back to the user timezone when read.

If you are using the Dynamics CRM Outlook Client, the timezone settings of Windows are used. If you use the web-client, it uses the timezone setting in your personal options. Make sure it is correct.

SDK

The SDK always use UTC for dates and does not convert them in any way. It is your responsibility to convert the data in an appropriate way. However, the CrmDateTime class contains some useful methods and properties for that.

Reports

Make sure that you only access the FilteredViews (for example FilteredAccount, which is btw the only supported use of the database). Date fields are automatically converted into the right timezone (according to the user settings). If you need to access the raw value, it is available as column with utc postfix (createdon -> createdonutc). To format date values according to the user/system settings you can access these settings also in reports. See "Formatting Content"

吐个泡泡 2024-11-08 09:44:01

Dynamics CRM 附带的两个 UDF 也很方便:

fn_UTCToLocalTime(@dateTime)
fn_LocalTimeToUTC(@dateTime)

它们使用系统用户声明的时区与 UTC 进行转换,并考虑 DST。

Also handy are two UDFs that come with Dynamics CRM:

fn_UTCToLocalTime(@dateTime)
fn_LocalTimeToUTC(@dateTime)

These translate to/from UTC using the system user's declared timezone and DST is taken into account.

柏拉图鍀咏恒 2024-11-08 09:44:01

看来我的问题是通过将 DateTime 值从 UTC 转换为本地时间来解决的。

(我希望将 ckeller 的评论标记为答案,但似乎没有办法做到这一点。非常感谢 ckeller。)

It seems that my problem is solved by converting DateTime values from UTC to local time.

(I was hoping to mark ckeller's comment as an answer but it seems there is no way to do that. Thanks very much ckeller.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文