server_offset_time
Last updated Apr 7th, 2019 | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$311 per month—let's make that $500!
Learn moreserver_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.
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$311 per month—let's make that $500!
Learn more