7. Dates and Times

There's a large list of packages related to dates and times on the calendar topic, timetable topic and date-time topic pages.

However, once you discount the plain TeX macros, the old LaTeX2.09 styles, the packages that aren't included in TeX Live or MiKTeX, packages that don't have English documentation and packages that don't have proper documentation (just an example file or plain text file), then the list becomes much smaller and can be divided into those that provide commands to: compute dates; display calendars or timetables; display specific dates or times; or display the current time or the current date in a particular format (by redefining \today). Some of the packages cover more than one of these categories.

The datetime package, which can be used to display formatted dates and the current time, was described in Volume 1 and so is not covered here. Similarly the babel package [7], which also redefines \today, was described in Volume 1. Since I started writing this book, I have replaced datetime with datetime2, which uses some of the code described in this chapter, so datetime2 is briefly introduced in §7.1 The datetime2 Package.

In this book, “current time” and “current date” (or \today) indicate the time or date of the TeX run that created the resulting PDF (or DVI) document. If you actually want a real time clock in your document, you can use the tdclock package [70] however this will only work if your PDF viewer not only supports JavaScript (such as Adobe Reader) but also has JavaScript enabled.

Surprisingly none of the above CTAN date-related topics include the pgfcalendar package that comes with the pgf bundle [102]. This is a useful date utility package that can be used for computing dates by adding or subtracting days from a given date. It also has commands that display month and week day names, so it can be used for parsing and formatting dates. In addition, since the pgf package's main function is graphical, pgfcalendar can be used to display calendars.

This chapter is arranged as follows:

This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-07-4).

© 2015 Dickimaw Books. "Dickimaw", "Dickimaw Books" and the Dickimaw parrot logo are trademarks. The Dickimaw parrot was painted by Magdalene Pritchett.

Terms of Use Privacy Policy Cookies Site Map FAQs