Date/time conversions

Current version: 9.0

The Sitecore UTC implementation handles multi-instance CMS solutions that are spread across different time zones. There are both methods and attribute settings that control how date/time values are displayed.

Methods

The following helper methods in the Sitecore.DateUtil class handle all new date/time conversion operations:

  • .ToUniversalTime – converts server date and time to universal time.

  • .ToServerTime – converts universal date and time to the server time.

Attributes

You can use the following attributes to work with date/time conversions:

  • Sitecore.Utc – indicates that the selected symbol is a UTC date/time with DateTime.Kind set to DateTimeKind.Utc.

Sitecore.ServerTime – indicates that the selected symbol is a date/time in the server time zone with DateTime.Kind set to DateTime.Kind.Unspecified.

Do you have some feedback for us?

If you have suggestions for improving this article,