time_ago - Liquid Filter Reference - 1.0.0

Filter Name time_ago
Group Dates
Version 1.0.0

Description

Returns a time distance string for a given date

Examples

When datetime is in UTC:
{{ "2021-07-01T09:00:43Z" | time_ago }}
about 10 hours
When datetime has an offset:
{{ "2021-07-01T09:00:43+10:00" | time_ago }}
less than a minute
When the date is in the future:
{{ "2021-09-01T09:00:00" | time_ago }}
2 months
When the date is in the past:
{{ "2021-03-01T09:00:00" | time_ago }}
4 months

Back to Filter List

Back to Liquid Reference for 1.0.0

 

 
Back to Documentation