[Tex/LaTex] ISO Date format with Biblatex/Biber

biberbiblatexbiblatex-chemdatetime

I'm using biblatex/biber with the biblatex-chem package to make a list of citations for group meeting. This works quite well, but I wanted to add a recent C&EN article to it, since it is quite relevant to my groups work. I can do this with the @online entry, but it uses the date in the form 03/03/2015 (dd/mm/yyyy) for the urldate. This is not the same as the article date format (MON. DD, YYYY). Regardless of is this is right for the format (it is for group meeting, not a publication), is there a way I can change both of these to ISO format (YYYY-MM-DD)? I've tried \usepackage[yyyymmdd]{datetime} with no success. There is this answer, but it is rather intimidating, and I suspect would only change the date published, not date accessed.

MWE:

\documentclass[letterpaper, 11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\begin{filecontents}{test.bib}
@online{Bonding,
  author = {Stu Borman},
  title = {Spying On Bond Making In Solution},
  year = 2015,
  month = 2,
  day = 19,
  url = {http://cen.acs.org/articles/93/i8/Spying-Bond-Making-Solution.html},
  urldate = {2015-03-03},
  addendum= {All about dicyanoaurate, has links to papers.}
}
\end{filecontents}

\usepackage[backend=biber,style=chem-rsc,articletitle=true]{biblatex}
\bibliography{test.bib}

\begin{document}
Foo Bar Baz

\nocite{*}
\printbibliography[heading = none]
\end{document}

Best Answer

Update #2 (biblatex >= 3.10)

Yet again new conventions in biblatex 3.10. Now edtf has been replaced by iso.

Updated MWE:

\documentclass[letterpaper, 11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\begin{filecontents}{test.bib}
@online{Bonding,
  author = {Stu Borman},
  title = {Spying On Bond Making In Solution},
  date = {2015-02-19},
  url = {http://cen.acs.org/articles/93/i8/Spying-Bond-Making-Solution.html},
  urldate = {2015-03-03},
  addendum= {All about dicyanoaurate, has links to papers.}
}
\end{filecontents}

\usepackage[backend=biber,style=chem-rsc,articletitle=true,urldate=iso,date=iso,seconds=true]{biblatex}
\addbibresource{test.bib}

\begin{document}
Foo Bar Baz

\nocite{*}
\printbibliography[heading = none]
\end{document} 

If all date formats have to be in ISO format (not only date and urldate) you can simply use alldates=iso instead of urldate=iso and date=iso.


Update #1 (biblatex >= 3.5)

As of biblatex 3.5, iso8601 is deprecated and edtf together with seconds=true should be used.

Using day, month and year as fields is also deprecated, so you should use the field

date = {2015-02-19},

in your .bib file instead of the three

year = 2015,
month = 02,
day = 19,

Updated MWE:

\documentclass[letterpaper, 11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\begin{filecontents}{test.bib}
@online{Bonding,
  author = {Stu Borman},
  title = {Spying On Bond Making In Solution},
  date = {2015-02-19},
  url = {http://cen.acs.org/articles/93/i8/Spying-Bond-Making-Solution.html},
  urldate = {2015-03-03},
  addendum= {All about dicyanoaurate, has links to papers.}
}
\end{filecontents}

\usepackage[backend=biber,style=chem-rsc,articletitle=true,urldate=edtf,date=edtf,seconds=true]{biblatex}
\addbibresource{test.bib}

\begin{document}
Foo Bar Baz

\nocite{*}
\printbibliography[heading = none]
\end{document} 

If all date formats have to be in ISO format (not only date and urldate) you can simply use alldates=edtf instead of urldate=edtf and date=edtf.


Original answer

Add the options urldate=iso8601 and date=iso8601 when loading biblatex (and remember to add the leading zeroes in fields like month when needed).

MWE:

\documentclass[letterpaper, 11pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}

\begin{filecontents}{test.bib}
@online{Bonding,
  author = {Stu Borman},
  title = {Spying On Bond Making In Solution},
  year = 2015,
  month = 02,
  day = 19,
  url = {http://cen.acs.org/articles/93/i8/Spying-Bond-Making-Solution.html},
  urldate = {2015-03-03},
  addendum= {All about dicyanoaurate, has links to papers.}
}
\end{filecontents}

\usepackage[backend=biber,style=chem-rsc,articletitle=true,urldate=iso8601,date=iso8601]{biblatex}
\addbibresource{test.bib}

\begin{document}
Foo Bar Baz

\nocite{*}
\printbibliography[heading = none]
\end{document} 

enter image description here

BTW: Using \addbibresource instead of \bibliography is recommended with biblatex.


If all date formats have to be in ISO format (not only date and urldate) you can simply use alldates=iso8601 instead of urldate=iso8601 and date=iso8601.

Related Question