Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

How can I define and use the date format "1 Jan 2012 7.03am"?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

I'm answering my own question here, in the hope that other people might find this information useful. The answer is to use

\usepackage{datetime}
\settimeformat{ampmtime}
\newdateformat{mydate}{\THEDAY{ }\shortmonthname{ }\THEYEAR{ }\currenttime}

and then

\mydate\today

where you want to insert the date and time.

share|improve this answer
    
It would be better if you expanded the answer to cover also other date formats (for example in different languages). –  egreg Jan 21 '12 at 9:44
2  
Unfortunately a bug in ampmtime makes 12.22pm come up as "12.22 noon"! –  Harry Macpherson Jan 21 '12 at 12:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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