Date Filters

You are here:

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 '11/23/2024'.
{{ 'Now' | Date:'M/d/yyyy' }}
 

AsDateTimeUtc

Show Details

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

 

Date

Show Details

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

 

DateAdd

Show Details

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

 

DateDiff

Show Details

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

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

 

DatesFromICal

Show Details

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

 

DaysFromNow

Show Details

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

 

DaysInMonth

Show Details

Returns the number of days in the month you provide.

 

DaysSince

Show Details

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

 

DaysUntil

Show Details

Returns the number of days from now.

 

HumanizeDateTime

Show Details

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

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

 

IsDateBetween

Show Details

Determine if the provided date falls within a given range.

 

NextDayOfTheWeek

Show Details

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

 

SundayDate

Show Details

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

 

TimeOfDay

Show Details

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

Sets the time to midnight for a specific day.

Subscribe To Our Newsletter

Rock is a project of the Spark Development Network.