Date Showing Up Different in MS Dynamics CRM than that of SQL-Server

时光毁灭记忆、已成空白 提交于 2019-12-11 08:29:42

问题


My string dates are as follows in YYYYMM format:

201008
201009
201010
201011
201012
...

The following is my CONVERT statement in my stored procedure:

CONVERT (datetime, @FileName + '01', 112)

my results are showing up fine in SQL-Server as follows

2010-10-01
2010-11-01
2010-12-01
...

However, in MS Dynamics CRM they are showing up as the last day a month earlier (corresponding with the previous SQL-Server results) as follows:

9/30/2010
10/31/2010
11/30/2010
...

What the heck is going on here?


回答1:


You always have to remember that CRM stores the dates in UTC, but displays them as the users's timezone:

So for your example, when you're working in SQL the Date Time is in UTC, but when you look at CRM it's in your local time.




回答2:


Refer to the following thread:

http://social.microsoft.com/Forums/en-US/84074c91-4421-4544-83a7-c6eea28a39e9/crm-displays-different-date-than-stored-in-db?forum=crm



来源:https://stackoverflow.com/questions/22546785/date-showing-up-different-in-ms-dynamics-crm-than-that-of-sql-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!