|date_interface

  • New in : SPIP 1.4

The |date_interface filter applied to any #DATE tag will display the date in a more human-readable form.

Example : An article was published on Monday 18 April 2011 at 8:15 am.
[(#DATE)] without filter displays «2011-04-18 08:15:00»
[(#DATE|date_interface)] displays«18 April 2011 à 08h15min».

Depending on the current date, this filter returns different displays:

Difference of the date from the current date Displayed value
#DATE > 12 hours ago " dd mmmm yyyy at xxhyymin "
#DATE < 12 hours " xx hours ago "
#DATE < 1 hour " xx minutes ago "
#DATE < 1 minute " xx seconds ago "
#DATE equal to current date " 0 seconds ago "
#DATE later than current date "dd mmmm yyyy at xxhyymin"

See also

Author jack Published : Updated : 02/07/23

Translations : English, français, Nederlands