14

I tried using the datetime package, but it doesn't display the date in the format I want. What I would like is something like August 30, 2015.

How do I do this?

1 Answers1

20

You can use the datetime2 package:

\documentclass[english]{article}
\usepackage{babel}
\usepackage[useregional]{datetime2}

\begin{document}

\today

\end{document}

enter image description here

With datetime:

\documentclass{article}
\usepackage{datetime}

\newdateformat{monthdayyeardate}{%
  \monthname[\THEMONTH]~\THEDAY, \THEYEAR}

\begin{document}

\monthdayyeardate\today

\end{document}
Gonzalo Medina
  • 505,128
  • Do you know how I could push this to the right side of the page? I tried using \hfill, but it doesn't do anything. Using \begin{flushright} causes an error for some reason. – TheRealFakeNews Aug 30 '15 at 17:40
  • 3
    @AlanH Under normal circumstances \hfill should be enough; if it's not working for you, we need the code you are using. Please consider then opening a fresh new question. – Gonzalo Medina Aug 30 '15 at 17:43
  • You could use datetime2 but you might be happier not doing so :(. – cfr Aug 31 '15 at 00:57
  • @cfr Why is this so? – Gonzalo Medina Aug 31 '15 at 01:42
  • I wish I'd never tried to update. I cannot make it work. I cannot even, really, figure out how it is supposed to work or what I am supposed to do with it. I'm sure it is fine for English. I'm just using datetime with a fixed language file. That works fine and was straightforward to do. The original file for Welsh has Breton mixed in with it. So does the datetime2 version so I tried to correct it but I can't. Polyglossia is corrected. Babel is not but would be easy. datetime is easy but cannot be changed (except locally). datetime2... I'm sure it is not impossible, but it sure seems so. – cfr Aug 31 '15 at 01:48
  • This question is me just failing to get to grips with using it in English. I therefore have a partial language module written for Welsh but I've given up: if I can't even get to grips with the English version, I can't hope to translate it. Especially since translation essentially requires writing a chunk of the package's functionality. Whereas in datetime, you just really have to translate the strings, in datetime2 language modules must add functionality which plays nicely within a skeletal framework. – cfr Aug 31 '15 at 02:22
  • See also this question which basically concerns a similar point: that datetime2, unlike datetime, does not provide a common language-agnostic set of commands for typesetting dates. This is part of why creating a language module is a nightmare. But it also makes it impossible to create a document where you can be sure things will come out correctly if you switch the preamble from one language to another. datetime still seems the best option for multi-lingual to me, despite its limitations. – cfr Aug 31 '15 at 02:31
  • And me again. I seem to be peculiar in having so much trouble although not utterly alone. – cfr Aug 31 '15 at 02:52