Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add current time to \today with package datetime? (LaTeX)

Tags:

datetime

latex

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?

EDIT

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}.

like image 762
vy32 Avatar asked Oct 31 '10 18:10

vy32


People also ask

How to get current time in LaTeX?

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).

How to add today's date in LaTeX?

\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.

Which command is used for current date in LaTeX?

The \date command declares text to be the document's date. With no \date command, the current date is used.


1 Answers

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 
like image 200
nbz Avatar answered Sep 25 '22 10:09

nbz