fmt-datetime¶
Formats a date and time in some locale. Dates are assumed to be ISO dates.
Arguments¶
dt¶
The date and time to format. This can be a datetime or a dictionary with year, month, day, hour, minute, and second.
Example
locale¶
The locale to use when formatting the datetime. A Unicode Locale Identifier. As with dates, ca can be set to a bcp47 calendar name.
Example
#let dt = datetime(
  year: 2024,
  month: 5,
  day: 31,
  hour: 18,
  minute: 2,
  second: 23,
)
- #fmt-datetime(dt, locale: "en")
- #fmt-datetime(dt, locale: "ko")
- #fmt-datetime(dt, locale: "ar-u-ca-islamic")
- #fmt-datetime(dt, locale: "mk")
- #fmt-datetime(dt, locale: "so")
- #fmt-datetime(dt, locale: "fo")
- #fmt-datetime(dt, locale: "vi")
- #fmt-datetime(dt, locale: "vi-u-ca-buddhist")
date-length¶
The length of the formatted date part ("full", "long" (default), "medium", or "short").
Example
#let dt = datetime(
  year: 2024,
  month: 5,
  day: 31,
  hour: 18,
  minute: 2,
  second: 23,
)
*Full*
- #fmt-datetime(dt, date-length: "full")
- #fmt-datetime(dt, date-length: "full", locale: "tr")
- #fmt-datetime(dt, date-length: "full", locale: "nl")
*Long*
- #fmt-datetime(dt, date-length: "long")
- #fmt-datetime(dt, date-length: "long", locale: "hi")
- #fmt-datetime(dt, date-length: "long", locale: "da")
*Medium*
- #fmt-datetime(dt, date-length: "medium")
- #fmt-datetime(dt, date-length: "medium", locale: "ja")
- #fmt-datetime(dt, date-length: "medium", locale: "pt")
*Short*
- #fmt-datetime(dt, date-length: "short")
- #fmt-datetime(dt, date-length: "short", locale: "bn")
- #fmt-datetime(dt, date-length: "short", locale: "az")
time-length¶
The length of the formatted time part ("medium" or "short" (default)).