Skip to content Skip to footer navigation

Modify Date Modifier

Alters a timestamp by incrementing or decrementing in a format accepted by PHP's native strtotime() method.

date: January 1, 2000
{{ date | modify_date("-1 day") }}
{{ date | modify_date("next Sunday") }}
{{ date | modify_date("+3 months") }}
{{ Statamic::modify($date)->modifyDate('-1 day') }}
{{ Statamic::modify($date)->modifyDate('next Sunday') }}
{{ Statamic::modify($date)->modifyDate('+3 months') }}
December 31, 1999
January 2, 2000
April 1, 2000
Hot Tip!

This modifier returns a copy of the date β€” the original variable is left untouched for any additional modifiers.

A troll pointing a teaching stick
Warning!

Date modifiers preserve the date value's timezone by default. Dated entries use UTC. Enable localize_dates_in_modifiers in config/statamic/system.php to convert dates to your display timezone before applying modifiers.

Please refer to our Timezones guide for more information.

A troll pointing a teaching stick