0

I'm working on local instance where i saved date 08/01/2019 7:00 PM to sitecore item when i read this item from database I can read correct date but when i read from Solr index I was able to read 08/02/2019 1:00 AM,

There is 6 hour difference when i change the time, difference stays the same 6 hours, it is important that my time zone difference is exactly 6 hours from GMT, as sitecore instance is running on my local machine where time zone is set to (UTC-06:00) Central Time (US and Canada)

When i google it i came to know this setting in sitecore.config file

<setting name="ServerTimeZone" value="" />

I took help from this page and set different time zones but there was no effect on result

I also came across Solr setting in /bin/solr.in.sh file but did not help

SOLR_TIMEZONE=UTC

Date property/field looks like below, in Sitecore 7.2 it was working good but issue started with Sitecore 9

[IndexField("StartDate")]
public DateTime StartDate { get; set; }

Note: I was having issue while posting question as there was no available tag like Datetime or Server Time Zone etc.

2
  • Did you try to use this function "DateUtil.ToServerTime(Date)" while you are getting date? Aug 2 '19 at 6:01
  • I updated to my question how datetime field looks, it was working good in Sitecore 7
    – sairfan
    Aug 2 '19 at 15:46
0

By setting as below in sitecore.config i was able to get correct date

<setting name="ServerTimeZone" value="UTC" />

Please note that for previous versions i believe its in sitecore.analystics.config file

Not the answer you're looking for? Browse other questions tagged or ask your own question.