Skip to main content

Date Operators

When we need to work with dates, these operators will help with your markdown.

List of Operators

{{ year }}

Get the current year.

Example

{{year}}
<!-- 2017 -->

{{ date }}

The date operator is used to format a date. It takes two required arguments and an optional third argument for the timezone. The syntax for using this operator:

{{date datetime format timezone}}

The datetime argument represents the date and time value that you want to format. It can be a JavaScript Date object, a string that can be parsed into a Date object, or a number representing the number of milliseconds since the Unix epoch.

The format argument specifies the desired format for the date output. It follows the formatting tokens defined by Moment.js. For example, "DD-MM-YYYY" represents the day, month, and year in the format "21-01-2021".

The timezone argument is optional and allows you to specify the timezone for the date. It uses the tz database (also known as the Olson database) to determine the timezone. If not provided, the date will be formatted in the local timezone of the user's environment.

Examples

{{date}}
{{date now}}
<!-- Current date -->

{{date 1763792016000}}
<-- 2025-11-21T22:13:36-08:00 -->

{{date "DD/MM/YYYY"}}
<!-- 28/04/2015 -->

{{date "5 years ago" "YYYY"}}
<!-- 2020 -->

{{date now "DD-MM-YYYY" "America/New_York"}}
<!-- 21-11-2025 -->

{{ moment }}

Calculate a moment in time.

Example

{{moment format="MM/DD/YYYY"}}

Calculate a moment using deal variables

Examples

{{moment deal.terms.ContractPeriod.value}}

Date Manipulation

Examples

{{moment add="days" amount="7" format="MM/DD/YYYY"}}

Date Manipulation using deal variables

Examples

{{moment
deal.terms.ContractPeriod.value
add="days"
amount="7"
format="MM/DD/YYYY"
}}

Date from now and a specific dates

Examples

{{moment "10/06/2021" "fromNow"}}

Date from now and a specific dates using deal variables

{{moment deal.terms.ContractPeriod.value "fromNow"}}

Use moment as a helper. See handlebars.moment for more details.