Jump to main content Jump to doc navigation

server_offset_time

Other versions: 2.x (current) — Other languages: EN RU — Found a problem? Please edit this page or report an issue.

server_offset_time

Name: Server Offset Tim Type: Number Default: 0

MODX uses this setting to show dates and times (e.g. the Published On, Publish Date, Unpublish Date of a Resource) to Manager users in their Local Time. The intent is to free users from having to consider the server time when reading or setting dates and times. As a System Setting, it applies to all users automatically, but can be overridden per-user with a User Setting.

Enter the number of hours time difference between where you or your Manager users are and where the server is. Fractional and negative hours are valid, e.g. 1.5, -0.5. A value of 1 will set Local Time 1 hour ahead of the Server Time.

The Reports > System Info page shows you both the Server Time and Local Time, so it's a good way to confirm you've set this correctly.

Warning This setting is handled incorrectly in some places in MODX prior to 2.2.7, notably in the handling of auto publishing and unpublishing.

For the devs or dev-curious.. Server Time here means what time PHP thinks it is, i.e. with the time() function. MODX stores and compares Resource-related dates and times as Unix timestamps, relative to Server Time. The server_offset_time is used to calculate Local Time only in the view.