Latex tips 211:latex How to print out the exact time

Source: Internet
Author: User

Http://blog.sina.com.cn/s/blog_5e16f1770100grtj.html

When we enter the title of an article or book, we automatically add the date of the day, but how do we do it if we want to add the time of the computer to the document?
Solution:
With two macro packages providing the ability to print out time, the DateTime package and the Scrtime Pack offer different input options, such as 24-hour, 12-hour, and so on, readers can choose according to their own requirements.

Demo Code:
\documentclass{article}
\pagestyle{empty}
\SETCOUNTER{PAGE}{6}
\SETLENGTH\TEXTWIDTH{305.0PT}
\USEPACKAGE{CJK}
\usepackage{times}
\usepackage{datetime}
\usepackage{scrtime}
\begin{cjk}{gbk}{kai}
\begin{document}

Packages is available, both providing ranges of ways of printing the date, as well as of the time:this question would Concentrate on the time-printing capabilities, and interested users can investigate the documentation for details about D Ates.

The datetime package defines-time-printing functions: \xxivtime (for 24-hour time), \ampmtime (for 12-hour time) and \ Oclock (for Time-as-words, albeit a slightly eccentric set of words).

The Scrtime package (part of the compendious Koma-script bundle) takes a package option (12h or 24h) to specify how Times is to be printed. The command \thistime then prints the time appropriately (though there's no am or PM in 12h mode). The \thistime command also takes an optional argument, the character to separate the hours and minutes:the default is of Course:.

\large
The current computer's time and date are:


\xxivtime \, \today

\ampmtime\, \today

\oclock\, \today

\thistime\, \today

\END{CJK}
\end{document}

Excerpt from: Http://www.tex.ac.uk/cgi-bin/texfaq2html?label=time

Latex tips 211:latex How to print out the exact time

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.