Radical Design Course by Jack McDade

From the creator of Statamic

Learn how to make your websites standout and be remembered.

Just exceptional. Thank you so much, Jack, you smashed it.

— Hugo, Developer

timezone Modifier

Applies a timezone to a date value. Aliased as tz.

You may pass a PHP timezone value to specify a timezone.

when: 2015-01-27 11:00
{{ when | format('r') }}
{{ when | timezone('Australia/Sydney') | format('r') }}
{{ Statamic::modify($when)->format('r') }}
{{ Statamic::modify($when)->timezone('Australia/Sydney')->format('r') }}
Tue, 27 Jan 2015 11:00:00 -0500
Wed, 28 Jan 2015 03:00:00 +1100

Using no parameter will simply use the timezone defined in your system settings. This is useful if your date value
already contains a timezone, and you want to display it in the system timezone.

when: Tue, 27 Jan 2015 16:00:00 +0000 # Date in UTC
{{ when | timezone | format('r') }}
{{ Statamic::modify($when)->timezone()->format('r') }}
Tue, 27 Jan 2015 11:00:00 -0500 <!-- Assuming my system timezone is America/New_York -->
Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →