# How to print name of month as string?

I know I can print the current month (or day) as an integer with month (or day).

How can I make use of the localisation information to print it as a string?

03 -> March


.bib file:

@ONLINE{IPAustraliaStandardPatentApplication,
author = {{IP Australia}},
title = {Standard patent application process | IP Australia},
year = 2013,
note = {http://www.ipaustralia.gov.au/get-the-right-ip/patents/patent-application-process/standard-patent-application-process/},
urldate = {2013-05-21},
}


macro:

% URL Dates
\renewbibmacro*{urldate}{%
\printtext[parens]{%
\printfield{urlday}%
\printfield{urlmonth}%
\printfield{urlyear}%
}%
\newunit%
}


I want urlmonth to be printed as, eg, May.

• You've added the biblatex tag, but it sounds like you're asking for a solution that allows you to print the name of the current month anywhere in the document, right? – Jake May 23 '13 at 2:55
• If you are talking about the bibliography, then this is automatic: as long as the month is an integer, biblatex automatically localises the month based on the babel settings or language option. – PLK May 23 '13 at 3:44
• Jake - actually, I'm only interested in the bibliography. @PLK - it doesn't appear to be doing so. I'm getting the actual integer printed out in my bibliography when I do \printfield{month} – sapi May 23 '13 at 4:36
• For future reference, it would be helpful if you can construct a minimal working example (MWE) that community members can copy-and-paste to start working on a solution. – Werner May 23 '13 at 5:38
• In that case we will need a MWE as this looks more like a biblatex localisation issue. – PLK May 23 '13 at 9:41

The answer is very simple: the formatting of the urldate in the bibliography is controlled by the urldate option of the biblatex package. Thus

\documentclass{article}

\usepackage[backend=biber,urldate=comp]{biblatex}

\begin{document}

Test 1 \cite{IPAustraliaStandardPatentApplication}

\printbibliography

\end{document}


will produce the desired output (converting urlmonth to a word), assuming your bibliography is in test.bib. For more options consult section page 60 of section 3.1.2.1 of the biblatex manual.

Update: To change the exact format of the date you have to modify the definitions of the mkbibdatelong macro. This is defined in the language specific files, so in your case english.lbx (assuming you write in english).

To avoid modifying those you can do the redefining in your preamble. Below I include code which should print the date in the format "21 May, 2013". I have not tested all the corner cases, such as day but no month, etc.

\documentclass{article}

\usepackage[backend=biber,urldate=comp]{biblatex}

\AtBeginDocument{
\protected\def\mkbibdatelong#1#2#3{% y/m/d
% taken from english.lbx
\iffieldundef{#3} %day
{}
{\stripzeros{\thefield{#3}}\space}%
\iffieldundef{#2} %month
{}
{\mkbibmonth{\thefield{#2}}%
\iffieldundef{#3}
{\iffieldundef{#1}{}{\space}}
{,\nobreakspace}}%
%\iffieldundef{#1}{}{,\space}
\stripzeros{\thefield{#1}} %year
}%
}


• Thanks - that's got me almost there. One thing left - the format (when using \printurldate) is currently, eg, August 15, 2011. How can I swap this so that it becomes 15 August, 2011? – sapi May 24 '13 at 23:12