Radical Design Course by Jack McDade

From the creator of Statamic

Learn how to make your websites standout and be remembered.

Bought Jack McDade's course on design. Going through it now...and it is SO well done!

— Justin Jackson, Transistor.fm

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!

As of Statamic 5, this modifier will return a copy of the Date. Earlier versions would modify the variable directly which will be passed onto any additional modifiers.

Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →