问题
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