Tx · LaTeX & TikZ

How to Format BibLaTeX Dates as Day Month Year

Published By the 9to5Science editorial team

At a glance

  1. 1. Choose the date style

    For standard long dates, customize BibLaTeX’s localized long-date formatting macro.

  2. 2. Set the component order

    Print the day first, then the localized month name, then the year, with spaces between them.

  3. 3. Compile with Biber

    Run LaTeX, Biber, then LaTeX twice so the bibliography is updated.

BibLaTeX stores a date such as 2024-01-05 as separate year, month, and day components. The order in which those components appear is controlled by date-formatting macros, not by changing the date in your .bib file.

For a standard long date in the order day month year, customize the localized long-date macro. The example uses 5 January 2024 as its target format and handles dates that have no day or month as well.

Complete example

This example uses the authoryear style and Biber. The date macro prints the day as a number, the month as its localized name, and the year last.

\documentclass{article}
\usepackage[backend=biber,style=authoryear]{biblatex}
\addbibresource{references.bib}

\DefineBibliographyExtras{english}{%
  \protected\def\mkbibdateapalong#1#2#3{%
    \iffieldundef{#3}{}{% day
      \thefield{#3}%
      \iffieldundef{#2}{}{\space}}%
    \iffieldundef{#2}{}{% month
      \mkbibmonth{\thefield{#2}}%
      \iffieldundef{#1}{}{\space}}%
    \iffieldundef{#1}{}{\thefield{#1}}% year
  }%
}

\begin{document}
A cited work: \cite{example}.
\printbibliography
\end{document}

Save this as main.tex and create references.bib alongside it:

@book{example,
  author    = {Lee, Morgan},
  title     = {A Sample Book},
  date      = {2024-01-05},
  publisher = {Example Press},
  location  = {London}
}

When the selected style prints that date using the long-date format, it appears as 5 January 2024. \mkbibmonth converts the numeric month from the date field to its localized month name. The conditional checks prevent stray spaces if a date is incomplete: for example, a year-month date can appear as January 2024.

Compile in this order:

pdflatex main
biber main
pdflatex main
pdflatex main

Use the equivalent commands for your LaTeX engine if you are compiling with XeLaTeX or LuaLaTeX.

Why change a date macro?

A date field is not simply ordinary text with a date field format applied to it. BibLaTeX parses it into components and uses date-printing commands to decide their order and presentation. Redefining the relevant date macro changes how those components are rendered while leaving the bibliographic data intact.

The example defines the change for the english language and alters \mkbibdateapalong, the long date format. If your document uses another language, define the customization for that language instead. The month name then follows that language’s localization.

If the format does not change

The example applies when the style prints a date through \mkbibdateapalong. A bibliography style or a particular citation command may use a different date macro, such as a short format, or may define its own date-printing code. In that case, identify which macro the style calls and customize that format too. For example, a short numeric date requires a separate short-format definition; changing the long format alone does not guarantee that every date in the document changes.

Also check that the document selects the language whose extras you changed. With babel or polyglossia, the active language may not be English. If the bibliography uses a different language from the surrounding text, the relevant extras must match the bibliography language.

Common mistakes

  • Changing the .bib date order: Keep a date in ISO-style form, such as date = {2024-01-05}. Reordering the stored data is not the way to control printed order.
  • Redefining a field format: A \DeclareFieldFormat{date}{...} declaration is not a general substitute for customizing the date-printing macro; BibLaTeX formats date components through its date commands.
  • Expecting every date to change: Access dates, short dates, and dates printed by custom styles may use different formatting paths.
  • Skipping Biber: After changing bibliography data or a Biber-relevant option, run Biber and then LaTeX again. A TeX-side date-formatting change alone normally requires rerunning LaTeX, not Biber.

References

  1. The BibLaTeX Package: Programmable Bibliographies and Citations

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.