BibTeX, biblatex and biberReplaced US date format with UK in 'accessed'

Information and discussion about BiBTeX - the bibliography tool for LaTeX documents.
Post Reply
navtis
Posts: 4
Joined: Sun Nov 18, 2012 9:51 pm

Replaced US date format with UK in 'accessed'

Post by navtis »

I'm using biblatex, and my .bib input file is generated from Zotero, which inserts ISO-style dates in the urldate field (eg 2013-05-11). After processing using pdflatex a url I visited on 11th May appears as:
(Accessed: 05/11/2013)
with the US order of month followed by day. How can I change this to the UK order of day followed by month?

Thanks
Graham

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Replaced US date format with UK in 'accessed'

Post by cgnieder »

This does not seem like the default setting. Are you using biblatex's urldate option? It can have one of the following values: short, long, terse, comp, iso8601. It seems yo have set it to short or terse while you want long or comp.

Regards
site moderator & package author
navtis
Posts: 4
Joined: Sun Nov 18, 2012 9:51 pm

Replaced US date format with UK in 'accessed'

Post by navtis »

Thanks cgnieder,

Setting it to long or comp gives me:
(Accessed: May 11, 2013)
which is not exactly what I wanted (I wanted 11/5/2013), but at least this version can be understood correctly by a UK audience - this is a rushed submission for a coursework so I will probably leave it in the 'long' format rather than spending more time on it!

Thanks for your help
User avatar
cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Replaced US date format with UK in 'accessed'

Post by cgnieder »

Replying would be a lot easier if you had provided a Infominimal working example. I get the correct date format:

Code: Select all

\documentclass{article}
\usepackage[british]{babel}
\usepackage[urldate=long]{biblatex}
\addbibresource{\jobname.bib}

% a sample bib file from within the tex file:
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@online{ltxcom,
  title   = {\LaTeX{} community},
  url     = {http://www.latex-community.org},
  urldate = {2013-05-11}
}
\end{filecontents}

\begin{document}

\cite{ltxcom}
\printbibliography

\end{document}
urldate.png
urldate.png (14.26 KiB) Viewed 22865 times
Regards
site moderator & package author
navtis
Posts: 4
Joined: Sun Nov 18, 2012 9:51 pm

Replaced US date format with UK in 'accessed'

Post by navtis »

Aahh... I had

Code: Select all

\documentclass[fontsize=11pt]{scrartcl}
\usepackage{graphicx}
\usepackage{latexsym}
\usepackage{setspace}
\usepackage{appendix}
\usepackage[urldate=short,backend=bibtex,firstinits=true,style=gsbibstyle,citestyle=authoryear,sorting=nty,doi=false,isbn=false]{biblatex}
and hadn't loaded Babel, so I hadn't given it any options. Adding your:

Code: Select all

\usepackage[british]{babel}
fixed it for me. Thank you again!
ClemNad
Posts: 1
Joined: Wed Dec 29, 2021 7:55 pm

Replaced US date format with UK in 'accessed'

Post by ClemNad »

You can redefine the macro used by urldate:
\renewbibmacro*{urldate}{
(visited on \printfield{urlday}/\printfield{urlmonth}/\printfield{urlyear})
}
And you can change the sentence to Accessed: if you please.

Code: Select all

\documentclass{article}
\usepackage[british]{babel}
\usepackage{biblatex}
\renewbibmacro*{urldate}{
    (visited on \printfield{urlday}/\printfield{urlmonth}/\printfield{urlyear})
}
\addbibresource{\jobname.bib}

% a sample bib file from within the tex file:
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@online{ltxcom,
  title   = {\LaTeX{} community},
  url     = {http://www.latex-community.org},
  urldate = {2013-05-11}
}
\end{filecontents}

\begin{document}

\cite{ltxcom}
\printbibliography

\end{document}
references_date.png
references_date.png (27.36 KiB) Viewed 10693 times
Post Reply