You can update the formatting of the date and time merge tags by adding formatting information at the end of the tag.

Formatting the date:

To format just the date, we can use the format_date function, as shown below.

  • {{reservation.start | format_date(‘full’)}} will output the date as Day of the Week, Month Date, Year in writing, like this: Monday, November 15, 2021
  • {{reservation.start | format_date(‘long’)}} will output the date as Month Date, Year in writing, like this: November 15, 2021
  • {{reservation.start | format_date(‘medium’)}} will output the date as Month (abbreviated) Date, Year in writing, like this: Nov 15, 2021
  • {{reservation.start | format_date(‘short’)}} will output the date as Month/Date/Year in numbers, like this: 11/15/21

Formatting the time

Similarly, we use the format_datetime function to format both the date and the time together. format_datetime looks for the date format first, then the time format, so you can replace ‘none’ in any of the examples below with one of the date formats above to include both the date and time.

  • {{reservation.start | format_datetime(‘none’, ‘full’)}} will output the time as HH:MM:SS followed by AM or PM and the full timezone spelled out, like this: 10:30:00 AM Coordinated Universal Time
  • {{reservation.start | format_datetime(‘none’, ‘long’)}} will output the time as HH:MM:SS followed by AM or PM and the timezone abbreviated, like this: 10:30:00 AM UTC
  • {{reservation.start | format_datetime(‘none’, ‘medium’)}} will output the time as HH:MM:SS followed by AM or PM, like this: 10:30:00 AM
  • {{reservation.start | format_datetime(‘none’, ‘short’)}} will output the time as HH:MM followed by AM or PM, like this: 10:30 AM

Localizing the format

You are also able to update the formatting to match the local formatting for your hotel or your guests by adding a locale function to the end of the tag. Simply add locale = ‘xx’ to the end of the tag with a two-character country code where the xx is.

For example, {{reservation.start | format_datetime(‘short’, ‘short’, locale = ‘de’)}} will output the date and time in German formatting, like 15.11.21, 10:30.

Arrow-up