The methods to process date/time in analytics reports

Current version: 8.1

In Engagement Analytics reports, you can display date/time values, either in UTC or in the local server time zone.

The Analytics.Reports.DisplayDatesInUtc setting in the Sitecore.Analytics.config file controls whether dates display in UTC or local server time. If the value of this setting is true, date/time values are displayed in UTC in reports; otherwise, date/time values are displayed in the local server time zone in reports. The default value of this setting is false.

The Sitecore.Analytics.Reports.ReportDateInterpreter class' methods should be used to process date/time values in the Engagement Analytics reports:

Method

Description

ToUniversalTime(DateTime)

Converts date and time from UI to UTC, which is acceptable for the database.

Use this method to convert report range date/time values provided by the user to filter out the results from the database.

ToUITime(DateTime)

Converts UTC date/time from the database to a value acceptable for UI.

Use this method to display date/time values from the database in the UI.

GetDefaultUIStartDate()

Provides default start dates for the report range.

Use this method to initialize report range dates in the UI.

GetDefaultUIEndDate()

Provides default end dates for the report range.

Use this method to initialize report range dates in UI.

GetStartDateInclusive()

Includes start dates in the report range.

Use this method to process report range dates provided by the user.

GetEndDateInclusive()

Includes end dates in the report range.

Use this method to process report range dates provided by the user.

Do you have some feedback for us?

If you have suggestions for improving this article,