0

I use the following code in my preamble to automatically set the urldate field. However it outputs date as say 2015/2/2, instead of 2015/02/02, which Biber doesn't like. How can I modify the code to rectify this?

% Set urldate to today
\DeclareSourcemap{
\maps[datatype=bibtex]{
\map[overwrite=true]{
   \pertype{online}
   \step[fieldset=urldate,fieldvalue={\the\year-\the\month-\the\day}]
} 
}
}
  • 1
    You should look at How to convert a one digit number to a two digit number to make a proper conversion. – Werner Feb 25 '15 at 23:36
  • 1
    Do you really check your online sources every time you compile your document? If so, why? If not, you absolutely ought not to do this. The whole point of giving the date of access for a URL is that you are attesting the accuracy of your quotations and citations on the date that you obtained the information. If the content of the site later changes, your reader can recognise this. If you lie about the date at which you obtained the information, you make it more difficult for a reader to discover the cause of any discrepancy. And for what reason would you even want to lie about this? – cfr Feb 25 '15 at 23:44
  • @Werner - Thank you! That worked. cfr - You are right, of course. I am just a little too lazy. I only use it for trivial university report submissions anyway. – bluprince13 Feb 26 '15 at 0:00
  • @cfr (You've been responeded here my friend.) thirteen: If you're a bit lazy, then just put there today's date, or the date of the submission deadline (given you'll check the website again then). – yo' Feb 26 '15 at 0:34
  • Thanks @yo'. OP: And if somebody checks and the content is no longer there, and was no longer there on the relevant date? [If you think nobody will ever check, you are wrong. There are all kinds of reasons why people sometimes have to check just in order to assign a mark at all.] – cfr Feb 26 '15 at 1:39

Browse other questions tagged or ask your own question.