Skip to main content

format_date

An example template.

Browse this template in the repository →

The PDFs below are rendered live by PDF Server from the shipped examples.

example

Your browser can’t display this PDF inline — use the download link below.

Download PDF — format_date / example

Inputs

Render data

example

examples/example.json

{
"issued_on": "2014-01-01",
"created_at": "2026-05-20T09:00:00Z"
}

Data schema

schema.json

{
"type": "object",
"properties": {
"issued_on": {
"type": "string",
"format": "date",
"description": "A calendar date (YYYY-MM-DD), consumed by format_date."
},
"created_at": {
"type": "string",
"format": "date-time",
"description": "An RFC 3339 timestamp, consumed by format_time."
}
},
"required": [
"issued_on",
"created_at"
]
}

Template

template.handlebars

<html>
<head>
</head>
<body>
<h1>format_date</h1>
<p>ISO date: {{ issued_on }}</p>
<p>Long: {{ format_date "%A %d %B, %Y" issued_on }}</p>
<p>Short: {{ format_date "%d.%m.%Y" issued_on }}</p>
<p>Weekday: {{ format_date "%A" issued_on }}</p>

<h1>format_time</h1>
<p>Created at: {{ format_time "%Y-%m-%d %H:%M:%S" created_at }} ({{ created_at }})</p>
</body>
</html>