I'm trying to have my LaTeX articles print with both the current date and the time. I found a package called datetime
which lets me redefine \today
to a variety of formats. But it doesn't have an obvious way to modify \today
to include the time, and the code is so twisted that I can't figure it out myself. Is there an easy way to do this?
I want to have the time automatically printed with the date on the front page when I run the \maketitle
command. As by default, it executes in the hidden command \date{\today}
.
Latex knows two packages that provide functionality related to time, datetime and KOMA-Script's scrtime . \currenttime prints the actual time (hh:mm by default).
\date: If you omit this command in the topmatter then the default is \today. If you want to put a specific date then type it in the argument to \date{...}. If you do not want a date then type \date{} with the argument empty. \documentclass: This is always the first line (command) in any LaTeX file.
The \date command declares text to be the document's date. With no \date command, the current date is used.
Nevermind my comment, I found something that works without all the makeatletters
\usepackage{datetime} %... \title{This is the Title} \author{An Author's name} \date{\currenttime} \maketitle
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With