积极答复者
AuditData表中所有事件的时间均与本地时间相差8小时,求解.

问题
答案
-
您好!
首先要说您描述的现象是正常的,Microsoft 使用的国际标准 24 小时计时系统的协调世界时 (UTC) 格式来记录和创建的日期和时间在软件更新中包括的文件。
Notice that Windows SharePoint Services tracks the times for audit events based on Coordinated Universal Time (Greenwich Mean Time).
详细的信息,您可以参考下面的链接:
http://msdn.microsoft.com/zh-cn/library/bb397403(en-us).aspx
有关如何转换UTC时间和本地时间,请参考下面的链接:
如何将 UTC 时间转换为本地时间
http://support.microsoft.com/kb/884804/zh-cn
Rock Wang
Rock Wang– MSFT- 已标记为答案 Rock Wang– MSFTModerator 2010年3月29日 2:32
-
Hi,我之前也遇到过你的情况!我使用 Convert.ToDateTime("you time").ToLocalTime(); 就可以了!
如果还不行使用:
DateTime time = DateTime.ParseExact(....);
// First get the current SPTimeZone of SPWeb:
SPTimeZone timeZone = web.RegionalSettings.TimeZone;
// Convert date and time in local:
DateTime localDT = timeZone.UTCToLocalTime (time);详细见:
http://social.microsoft.com/Forums/zh-CN/partnercndevsharepoint/thread/ef51dd2f-c643-4d72-ab15-fe675be9832d
还有:http://blog.csdn.net/jinho/archive/2010/02/25/5325526.aspx
希望能对你有帮助!
Anything Is Possible !- 已标记为答案 Rock Wang– MSFTModerator 2010年3月29日 2:31
全部回复
-
您好!
首先要说您描述的现象是正常的,Microsoft 使用的国际标准 24 小时计时系统的协调世界时 (UTC) 格式来记录和创建的日期和时间在软件更新中包括的文件。
Notice that Windows SharePoint Services tracks the times for audit events based on Coordinated Universal Time (Greenwich Mean Time).
详细的信息,您可以参考下面的链接:
http://msdn.microsoft.com/zh-cn/library/bb397403(en-us).aspx
有关如何转换UTC时间和本地时间,请参考下面的链接:
如何将 UTC 时间转换为本地时间
http://support.microsoft.com/kb/884804/zh-cn
Rock Wang
Rock Wang– MSFT- 已标记为答案 Rock Wang– MSFTModerator 2010年3月29日 2:32
-
Hi,我之前也遇到过你的情况!我使用 Convert.ToDateTime("you time").ToLocalTime(); 就可以了!
如果还不行使用:
DateTime time = DateTime.ParseExact(....);
// First get the current SPTimeZone of SPWeb:
SPTimeZone timeZone = web.RegionalSettings.TimeZone;
// Convert date and time in local:
DateTime localDT = timeZone.UTCToLocalTime (time);详细见:
http://social.microsoft.com/Forums/zh-CN/partnercndevsharepoint/thread/ef51dd2f-c643-4d72-ab15-fe675be9832d
还有:http://blog.csdn.net/jinho/archive/2010/02/25/5325526.aspx
希望能对你有帮助!
Anything Is Possible !- 已标记为答案 Rock Wang– MSFTModerator 2010年3月29日 2:31
-
Hi,我之前也遇到过你的情况!我使用 Convert.ToDateTime("you time").ToLocalTime(); 就可以了!
如果还不行使用:
DateTime time = DateTime.ParseExact(....);
// First get the current SPTimeZone of SPWeb:
SPTimeZone timeZone = web.RegionalSettings.TimeZone;
// Convert date and time in local:
DateTime localDT = timeZone.UTCToLocalTime (time);详细见:
http://social.microsoft.com/Forums/zh-CN/partnercndevsharepoint/thread/ef51dd2f-c643-4d72-ab15-fe675be9832d
还有:http://blog.csdn.net/jinho/archive/2010/02/25/5325526.aspx
希望能对你有帮助!
Anything Is Possible !
你好,你的这些方法好像都是对结果进行转换的吧?另外第一个链接打不开.能不能直接让数据库中就按本地时区来记录时间呢?