Time/Date

time_ago_in_words

time_ago_in_words will format the time/date value as the difference between the value and the current time

Input

{{ product.created_at | time_ago_in_words }}
{{ 'Sun, 28 Jun 2020 10:34:40 UTC +00:00' | time_ago_in_words }}
{{ 'Sun, 28 Jun 2020 10:34:40 UTC +00:00' | time_ago_in_words }} ago

Output

1 year
10 hours
10 hours ago