2

I have a mechanism that is automatically creating content items and setting dates accordingly. Dates are being set in UTC by the code.

For my local development machine, I am in the central timezone (CST). All dates that are displayed to me appear to be in the central timezone, but are in fact stored as UTC. This seems correct.

On my development server, however, the operating system is in UTC time. I have noticed that when I login to the CMS on the server, dates are displayed to me in UTC time.

What is the proper way to adjust the display of dates so that they are displayed to the user in CST from the server? Is setting <setting name="ServerTimeZone" value="600"/> enough, and what other repercussions will occur if I set this value?

3

Looks like you are in the right direction.

1) The ServerTimeZone config needs to be set to match your timezone.

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

2) If you are running versions earlier than Sitecore 9.0, make sure you didn't change the default value (false) of this setting. Keeping it as false will display local server time zone in analytics reports

<setting name="Analytics.Reports.DisplayDatesInUtc" value="false" />

3) In your codes which creates content, continue storing your date/time in UTC format. This way, date/time in your database is always in UTC, and the ServerTimeZone setting merely changes how it is being converted and displayed in local time.

You can find more details in these 2 links

https://doc.sitecore.com/developers/90/sitecore-experience-management/en/settings-supporting-utc-implementation.html

https://doc.sitecore.com/developers/90/sitecore-experience-management/en/storing-date-time-values-in-databases.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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