自定义日期托管属性在搜索结果中显示错误的日期 [英] Custom Date Managed Property showing wrong date in Search Results

查看:91
本文介绍了自定义日期托管属性在搜索结果中显示错误的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我正在创建一个新的展示模板,其中包含所请求的自定义托管属性。 其中一列是日期列(请参阅下面的澳大利亚格式的"决定日期")。 日期显示为2018年7月10日(见下文)

I am creating a new Display Template with custom Managed Property as requested.  One of the columns is a date column (see "Decision Date" below in Australian format).  Date is showing as 10 July 2018 (see below)

当我进入实际项目所在的列表时,此日期不同(见下文)

When I go into the list where the actual item is, this date is different (see below)

两个网站的"区域设置"都设置为澳大利亚。 

Both sites Regional Settings are set to Australia. 

知道为什么搜索结果会在一天之后落后吗?

Any idea why the search results are behind by a day?

推荐答案

可以在Web应用程序级别,网站集或站点级别设置区域设置。也许您的网站和网络应用程序使用不同的区域设置。 

Regional settings can be set at web application level, site collection or site level. Maybe your site and web application use different Regional Settings. 

我曾经阅读过博客,它说:

I used read a blog, it says:

SharePoint stores its datetime fields in UTC time. If you don’t look at the data from SharePoint through

来查看SharePoint中的数据(UI根据本地时间更正日期时间值),则需要使用UTC更正日期时间字段

the UI (the UI corrects datetime values according to local time), you need to correct the datetime fields

你在本地的偏移。

它提供了一个关于使用代码的解决方案,通过明确添加+1天。

And it provides a solution about using code by explicitly adding a +1 day.

参考:

http://itblog.wolthaus.net/2011/09/sharepoint-stores-dates-in-utc-time/

祝你好运,

Allen Bai

Allen Bai


这篇关于自定义日期托管属性在搜索结果中显示错误的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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