Skip to content Skip to footer navigation
🏰 Statamic Summit 2027 Feb 16–19 Talks, workshops, and three nights in a German castle. Get Tickets

Months Ago Modifier

Returns the number of months since a given date variable. Statamic will attempt to parse any string as a date, but try to keep it in the least ambiguous date format possible.

# Assuming the current date is December 19, 2012.
date: June 19 2012
{{ date | months_ago }}
{{ Statamic::modify($date)->monthsAgo() }}
6