2

Is there an easy way to get biblatex/biber to output the date field to include the time? I'm using @video (and @photo) which, as far as I can tell, lack drivers by default and so fall back to something equivalent to @misc.

I can specify the date in yyyy-mm-ddTHH:MM:SS format per the manual, but all of my attempts to set options (e.g. dateusetime=1) per various documents I've read have failed to produce the time in the references.

The context is a number of photos and video files with a timestamp in the corner where I'd like to reference the exact date and time of an event. I could write drivers for @video and @photo, but that seems like overkill if there's an easier solution that I've so far failed to find.

Much-requested MWE:

\begin{filecontents}{mwe1.bib}
@photo { img-noodles,
    author = {{Security Camera}},
    title  = {Suspect eating noodles},
    date   = {2016-01-01T15:43:21},
}
\end{filecontents}

\documentclass{article}
\usepackage[backend=biber,sorting=none,dateabbrev=false,
    dateusetime=1,time=24h]{biblatex}
\addbibresource{mwe1.bib}

\begin{document}
This is a test~\autocite{img-noodles}.
\printbibliography
\end{document}

MWE Output

Edit: also included @photo and an obvious use case where a full timestamp is necessary (based on comments).

  • 1
    Welcome to TeX.se. It would be helpful if you could give a minimal compilable document showing the bibliography style you're using, and a sample .bib file entry that people could play with. – Alan Munn Aug 8 at 0:10
  • 1
    If we consider @video analogous to a @book and the time in the video corresponds to a page, then usually you would just reference the complete video without timestamp in the bibliography and add the exact timestamp in the citation: \cite[3:33]{myvideo}. In any case a short example document showing both which style you use and how you cite the video in question (including an example @video entry) would be greatly appreciated. – moewe Aug 8 at 5:53
  • @moewe Yes, I am aware of that option. Alternatively, you could view a long video as a collection, compendium, or compilation of clips, each of which is cited separately, even though they're ultimately in the same "document". In this case, the "collection of clips/articles" analogy is preferred over the "cite a position/page" analogy. – Emmet Aug 9 at 0:16
  • Mhhh I guess I could buy the @collection interpretation if the video has clearly distinct scenes (acts, sub-clips, ... whatever, ideally those scenes are associated with different primary "authors", otherwise it is still a @book with different chapters). Anyhow, the date field would not be appropriate to give the position in the video. After all the date (usually) refers to the date of publishing a work. It would be more natural to define a new field for the timestamp (or if you can't be bother to do that abuse the pages field). – moewe Aug 9 at 1:41
  • Please consider editing your question and adding a short example document that shows what you have so far, which style you use and what your .bib entry looks like at the moment (an MWE: tex.meta.stackexchange.com/q/228/35864, tex.meta.stackexchange.com/q/4407/35864). – moewe Aug 9 at 1:42
2

The second issue mentioned here (https://github.com/plk/biblatex/issues/909) has been fixed in biblatex 3.13.

Please update your TeX distribution to obtain current versions of biblatex and Biber.

There are two issues here

Firstly, dateusetime=1, does not enable dateusetime. The option expects the values true or false, anything that is not true will be treated as false.

But even with dateusetime=true, the output is not as expected since the default truncated date formats forgot about times. This is a bug that should be fixed in the next version of biblatex, see https://github.com/plk/biblatex/issues/909. In the meantime it is probably easier to use one of the full date formats that supports printing the time. So for the time being you need an explicit date=long (or date=short, date=ymd, date=iso) to override the default date=comp, which drops the time.

\documentclass{article}
\usepackage[backend=biber, sorting=none,
  time=24h, dateabbrev=false, dateusetime=true,]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@photo{img-noodles,
  author = {{Security Camera}},
  title  = {Suspect eating noodles},
  date   = {2016-01-01T15:43:21},
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
This is a test~\autocite{img-noodles}.
\printbibliography
\end{document}

Security Camera. Suspect eating noodles. January 1, 2016 15:43.


By default biblatex does not show seconds, this can be enabled with the load-time option

seconds=true,
  • That's great, thank you. Any idea how I might get it to display the seconds as well? This is much better and probably enough, but displaying seconds too would be ideal. – Emmet Aug 10 at 16:32
  • @Emmet The option seconds=true, should display seconds, see the edit. – moewe Aug 10 at 20:15
  • That does the trick! Thank you. – Emmet Aug 16 at 22:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.