Changing the Date Format Displayed by Quarto

r
quarto
A note on changing the displayed date format in Quarto with the date-format option.
Published

2026-01-30

Modified

2026-01-30

Note

When Quarto displays dates for blog posts, the default format is the medium date style. This looks like Jan 30, 2026. However, there are times when you may want to display dates in an ISO 8601 style such as 2026-01-30.

The date-format Option

To change how Quarto displays dates, set the date-format option. You can change the displayed date format by specifying this option in a YAML header or in _quarto.yml. The place where this is most commonly used is probably the listing page for blog posts.

When listing multiple articles, such as blog posts, add the date-format option to the YAML header of posts.qmd.

posts.qmd
---
title: "Blog"
listing:
  contents: posts
  sort: "date desc"
  type: default
  categories: true
  date-format: iso
---

If you want to change the date format on individual article pages, add the date-format option to each article’s YAML header.

posts/2026-01-30-quarto-data-format.qmd
---
title: "Changing the Date Format Displayed by Quarto"
date: "2026-01-30"
date-modified: "2026-01-30"
date-format: iso
---

You can also add it as a global setting in _quarto.yml.

_quarto.yml
date-format: iso

Types of Date Formats

There are two ways to change the display format.

  1. Specify a date style.
  2. Specify a custom format.

Specifying a Date Style

Quarto supports date styles such as the following.

  • short: short format, for example 1/30/26
  • medium: medium format, for example Jan 30, 2026
  • long: long format, for example January 30, 2026
  • full: full format, for example Friday, January 30, 2026
  • iso: ISO 8601 format, for example 2026-01-30

Specifying a Custom Format

If you want finer control over the style, use a custom format. To specify a custom format, set a format string in the date-format option. For example, to display dates as 2026/01/30, specify the following.

date-format: "yyyy/MM/dd"
Note

For details on custom formats, see the following official documentation.

Differences by Language Setting

In Quarto, the displayed date format is also affected by the language setting. For example, with a Japanese setting, the medium style is displayed like 2026年1月30日. To change the language setting, set the lang option in a YAML header or in _quarto.yml.

_quarto.yml
format:
  html:
    lang: ja

It may also be fine to set it at the top level.

Note

For details on the lang option, see the following official documentation.

References