Date Filters

Date Filters

These date filters allow you to modify the formating of dates in some pretty cool ways!

Now! When working with dates you'll often want to get the current date/time. This is possible with the 'Now' keyword. You can use in places where you'd normally input a date/time to use the current date/time. Consider the example below which would display today's date like '9/22/2019'.
{{ 'Now' | Date:'M/d/yyyy' }}
    
<!-- New in V10 - No parameters are required to assign the current date.-->
{% assign now = 'Now' | Date %}
 

Date

Show Details
Server: v1.0

Displays the date given a format string. The string 'Now' can be used for the current date/time.

 

DateAdd

Show Details
Server: v4.0

Adds a span of time to a provided date (default is in days).

 

DateDiff

Show Details
Server: v1.0

Takes two datetimes and returns the difference in the unit you provide. You can provide the value 'Now' for either the start or end date.

 

DatesFromICal

Show Details
Server: v4.0

Returns a list of upcoming dates from an iCal string or List of iCal strings.

 

DaysFromNow

Show Details
Server: v4.0

Returns a humanized string of the number of days from now without concern for time.

 

DaysInMonth

Show Details
Server: v7.0

Returns the number of days in the month you provide.

 

DaysSince

Show Details
Server: v8.0

Returns the number of days have past since a given date.

 

DaysUntil

Show Details
Server: v8.0

Returns the number of days from now.

 

HumanizeDateTime

Show Details
Server: v1.0

Compares the provided date/time to the current date/time and returns a human friendly string like 'yesterday' or '2 hours ago'.

 

HumanizeTimeSpan

Show Details
Server: v1.0

Takes two datetimes and humanizes the difference like '1 day'. Supports 'Now' in either the start or end date.

 

NextDayOfTheWeek

Show Details
Server: v8.0

Advances the date to a specific day in the next 7 days.

 

SundayDate

Show Details
Server: v5.0

Returns the Sunday date portion (without any time portion) of the date provided.

 

ToMidnight

Show Details
Server: v8.0

Sets the time to midnight for a specific day.