在MS Dynamics CRM中显示与SQL Server不同的日期 [英] Date Showing Up Different in MS Dynamics CRM than that of SQL-Server

查看:102
本文介绍了在MS Dynamics CRM中显示与SQL Server不同的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的字符串日期如下: YYYYMM 格式:

My string dates are as follows in YYYYMM format:

201008
201009
201010
201011
201012
...

以下是我的存储过程中的 CONVERT 语句:

The following is my CONVERT statement in my stored procedure:

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

我的结果是在SQL Server中显示如下

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

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

但是,在MS Dynamics CRM中,显示为一个月前的最后一天(与之前的SQL Server的结果相对应)如下:

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
...

这里发生了什么?

推荐答案

你必须记住,CRM将日期存储在UTC ,但将它们显示为用户的时区:

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

所以在你的例子中,当你在SQL中工作时,日期时间是UTC,但是当你看到CRM的时候,就在你当地的时间。

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.

这篇关于在MS Dynamics CRM中显示与SQL Server不同的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆