Date Filters

Date Filters

These date filters allow you to modify the formatting 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 '12/21/2024'.
{{ 'Now' | Date:'M/d/yyyy' }}
    
<!-- New in V10 - No parameters are required to assign the current date/time.-->
<!-- However, it is advised you always specify the date format to avoid      -->
<!-- international confusion.                                                -->
{% assign now = 'Now' | Date %}
 

AsDateTimeUtc

Show Details
Server: v14.1

Converts the input to a DateTime value in Coordinated Universal Time (UTC).

 

Date

Show Details
Server: v1.0 Mobile: 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 Mobile: v1.0

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

 

DateDiff

Show Details
Server: v1.0 Mobile: 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.

 

DateRangeFromSlidingFormat

Show Details
Server: v13.4

Provides a start and end date from a sliding date range format (typically from the Sliding Date Range control).

 

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 Mobile: v1.0

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

 

DaysInMonth

Show Details
Server: v7.0 Mobile: v1.0

Returns the number of days in the month you provide.

 

DaysSince

Show Details
Server: v8.0 Mobile: v1.0

Returns the number of days that have passed since a given date.

 

DaysUntil

Show Details
Server: v8.0 Mobile: v1.0

Returns the number of days from now.

 

HumanizeDateTime

Show Details
Server: v1.0 Mobile: 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 Mobile: v1.0

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

 

IsDateBetween

Show Details
Server: v14.0

Determine if the provided date falls within a given range.

 

NextDayOfTheWeek

Show Details
Server: v8.0 Mobile: v1.0

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

 

SundayDate

Show Details
Server: v5.0 Mobile: v1.0

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

 

TimeOfDay

Show Details
Server: v13.1

Returns a description of the time of day for an input value that represents a date/time. The keyword 'Now' can be used to represent the current time.

 

ToMidnight

Show Details
Server: v8.0 Mobile: v1.0

Sets the time to midnight for a specific day.