The {{#datetime}} templating helper outputs todays date in the format MMM D, YYYY.

Custom Data

You can specify your own Date value like this: {{#datetime 'dddd, Do MMMM YYYY' myDate}}

Custom Format

You can specify you own date format like this: {{#datetime 'dddd, Do MMMM YYYY'}}. See the table below for the complete range of formatting options.

Format Tokens

Input Example Description
YYYY 2014 4 digit year
YY 14 2 digit year
M 2 Month number
MM 02 Month number with leading zero to ensure 2 digits
MMM Jan 3 letter abbreviation of month name
MMMM January Month name
D 1 Day of the month
DD 01 Day of the month with leading zero to ensure 2 digits
Do 1st Day of the month with ordinal
DDD 1 Day of the year
ddd Monday Day name
h 7 Hour
hh 07 Hour with leading zero to ensure 2 digits
mm 05 Minute with leading zero to ensure 2 digits
A AM AM or PM
a am am or pm

Examples

If myDate is the 3/10/14 at 7:30pm:

  • {{#datetime}} Outputs todays date like -> Monday, 6th October 2014
  • {{#datetime ‘dddd, Do MMMM YYYY’ myDate}} -> Friday, 3rd October 2014
  • {{#datetime ‘Do MMMM YYYY’ myDate}} -> 3rd October 2014
  • {{#datetime ‘YYYY’ myDate}} -> 2014
  • {{#datetime ‘D/MM/YY’ myDate}} -> 3/10/16
  • {{#datetime ‘DD-MM-YYYY’ myDate}} -> 03-10-16
  • {{#datetime ‘Do MMMM YYYY [at] h:mma’ myDate}} -> 3rd October 2014 at 7:30pm
  • {{#datetime ‘dddd, Do MMMM YYYY [at] hh:mmA’ myDate}} -> Friday, 3rd October 2014 at 07:30PM
  • {{#datetime ‘hh:mmA’ myDate}} -> 07:30PM