1

I would like to change the date format that appears in the citation's "urldate". Right now it's at yyyy-mm-dd and I would like to change it to dd/mm/yyyy, I've tried with

\usepackage[ddmmyyyy]{datetime}
\renewcommand{\dateseparator}{//}

But when I enter a date with the desired format in the ref.bib file, it throws this error at me and no date is present in the pdf. And if I leave it in the old format it doesn't show properly.

Entry 'mantis' (ref.bib): Invalid format '07/03/2023' of date field 'urldate' - ignoring.

main file:

\documentclass[11pt, a4paper]{article}
\usepackage[a4paper,left=1.6cm, right=2cm, top=1.5cm, bottom=0.5cm,includefoot, footskip=30pt]{geometry}
%\usepackage[backend=biber, style=science]{biblatex} %authortitle
\usepackage[ddmmyyyy]{datetime}
\renewcommand{\dateseparator}{//}
\usepackage[english, czech]{babel}
\usepackage{csquotes}
\usepackage[backend=biber, babel=other, style=iso-numeric]{biblatex} %authortitle
\addbibresource{ref.bib}
\usepackage{url}
\usepackage{float}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{caption}
\usepackage{pdfpages}
\usepackage{setspace}
\usepackage{lipsum}

\DeclareCaptionType{code}[Kód][Seznam úryvků kódu] 

\definecolor{codegreen}{rgb}{0,0.6,0}
\definecolor{codegray}{rgb}{0.5,0.5,0.5}
\definecolor{codepurple}{rgb}{0.58,0,0.82}
\definecolor{backcolour}{rgb}{0.97,0.97,0.97}

\lstdefinestyle{mystyle}{
    backgroundcolor=\color{backcolour},   
    commentstyle=\color{codegray},
    keywordstyle=\color{codegreen},
    numberstyle=\tiny\color{codegray},
    stringstyle=\color{codepurple},
    basicstyle=\ttfamily\footnotesize,
    breakatwhitespace=false,         
    breaklines=true,                 
    captionpos=b,                    
    keepspaces=true,                 
    numbers=left,                    
    numbersep=5pt,                  
    showspaces=false,                
    showstringspaces=false,
    showtabs=false,                  
    tabsize=2
}

\lstset{style=mystyle}
\setcounter{section}{-1}
\renewcommand{\figurename}{Obr.}
\renewcommand*\listfigurename{Seznam obrázků}
\renewcommand{\lstlistingname}{Kód}
\renewcommand*\contentsname{Obsah}

%\onehalfspacing

\begin{document}
\section{sample}

\lipsum[1] \supercite{mantis}
\newpage
\begin{center}
        \printbibliography[title={Reference}]
\end{center}
\newpage
\listoffigures 
\newpage
\end{document}

ref.bib file:

@MISC{mantis,
    title={Voron Mantis dual 5015},
    url={https://github.com/VoronDesign/VoronUsers/tree/master/printer_mods/Long/Mantis_Dual_5015},
    urldate = {2023-03-07}, 
}

The date format that I want to change:

Default citation date format

1
  • Welcome to TeX.se. Can you add a small compilable example document that loads biblatex with the style you're using that produces the output in the image. This way people will be able to help you more easily.
    – Alan Munn
    Mar 7 at 20:22

1 Answer 1

2

The date format you see in the bibliography is controlled mainly by the style you use and additionally by the selected language. The package datetime has no control over biblatex's date output.

biblatex-iso690 styles like style=iso-numeric output most dates in ISO8601 format.

If you don't like this and prefer a more traditional output, use the option urldate=short,. For a Czech document like yours this gives dd. mm. yyyy.

\documentclass[11pt, a4paper]{article}
\usepackage[english, czech]{babel}
\usepackage{csquotes}
\usepackage[
  backend=biber,
  style=iso-numeric,
  babel=other,
  urldate=short,
]{biblatex}
\usepackage{hyperref}

\begin{filecontents}{\jobname.bib}
@MISC{mantis,
  title   = {Voron Mantis dual 5015},
  url     = {https://github.com/VoronDesign/VoronUsers/tree/master/printer_mods/Long/Mantis_Dual_5015},
  urldate = {2023-03-07}, 
}
\end{filecontents}
\addbibresource{\jobname.bib}

%\onehalfspacing

\begin{document}
\section{sample}

Lorem \supercite{mantis}
\printbibliography[title={Reference}]
\end{document}

Voron Mantis dual 5015 [online]. [B.r.]. [cit. 07.03.2023].


If you want dd/mm/yyyy, you need urldate=short, and additionally also need to redefine the short date format for Czech.

\documentclass[11pt, a4paper]{article}
\usepackage[english, czech]{babel}
\usepackage{csquotes}
\usepackage[
  backend=biber,
  style=iso-numeric,
  babel=other,
  urldate=short,
]{biblatex}
\usepackage{hyperref}

\DefineBibliographyExtras{czech}{%
  \protected\def\mkbibdateshort#1#2#3{%
    \iffieldundef{#3}
      {}
      {\mkdayzeros{\thefield{#3}}%
       \iffieldundef{#2}{}{/}}%
    \iffieldundef{#2}
      {}
      {\mkmonthzeros{\thefield{#2}}%
       \iffieldundef{#1}
         {}
         {/}}%
    \iffieldbibstring{#1}
      {\bibstring{\thefield{#1}}}
      {\dateeraprintpre{#1}\mkyearzeros{\thefield{#1}}}}}

\begin{filecontents}{\jobname.bib}
@MISC{mantis,
  title   = {Voron Mantis dual 5015},
  url     = {https://github.com/VoronDesign/VoronUsers/tree/master/printer_mods/Long/Mantis_Dual_5015},
  urldate = {2023-03-07}, 
}
\end{filecontents}
\addbibresource{\jobname.bib}

%\onehalfspacing

\begin{document}
\section{sample}

Lorem \supercite{mantis}
\printbibliography[title={Reference}]
\end{document}

Voron Mantis dual 5015 [online]. [B.r.]. [cit. 07/03/2023].

1
  • Thank you very much, that is exactly what I wanted.
    – mamimom892
    Mar 9 at 18:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .