How to manage time zones in Sitecore?

The current Sitecore date and time command assumes the local system time of the CM server (Eastern Standard / Daylight Time, in our case), when we select the dates and times for our events.

It quickly became apparent that we needed content authors to select time intervals for events. We initially decided to provide Droplist with predefined time zone abbreviations, such as "PST", "EST", "EDT", etc. Although this solution worked fine for display, we immediately ran into problems when trying to dynamically generate .ICS calendar assignments for events.

To generate .ICS files, we need a way to combine the start and end dates of the event (which is again in EST or EDT), and the time zone abbreviation (EST, PST, etc.) into a UTC DateTime object.

I understand that ASP.NET does not support abbreviations for time zones , so I think we are stuck keeping the list of abbreviations along with their UTC offset values. It is not enough to give our content authors a list of time zones, such as GMT -08: 00, GMT -07: 00, etc. We need to include some kind of abbreviation or name to help them make a choice.

Does Sitecore have built-in fields or utilities for selecting Timezones?

+5
source share
4

Sitecore , . Droplist Droplink ( , GUID), . . (, EDT, PDT ..), , . , , Droplink, Offset, . - :

ReferenceField timezoneSelected = item.Fields["Timezone"];
string offsetVal = timezoneSelected.TargetItem.Fields["Offset"].Value;
// parse out the true value from offsetVal
+5

UTC EST, PTS .. . .Net TimeZoneInfo, UTC . .

Sitecore , , Sitecore DateTime, , CMS. UTC .

, . UTC, EST, , .

+1

, , UTC, . , DMS xDB.

If this is not the case, it will break the Event Queue and deleted events (for example, publishing), since everything works through the core database and (by default) is checked for new events (which are actually records in the database with the corresponding timestamp )

+1
source

All Articles