Date

<< Click to Display Table of Contents >>

Navigation:  Appendix > Macros >

Date


 

welcome.icon.pdftools Date

 


 

The Date macro inserts the current date. Multiple date formats are available, as detailed below.

 

The syntax for this macro is %[Date] and the following parameters are available:

 

d inserts the day of the month and omits the zero in cases of single-digit values.

dd inserts the day of the month and includes a zero in cases of single-digit values.

ddd inserts the day of the week as a three-letter abbreviation.

dddd inserts the day of the week.

M inserts the month and omits the zero in cases of single-digit values.

MM inserts the month and includes a zero in cases of single-digit values.

MMM inserts the month as a three-letter abbreviation.

MMMM inserts the month.

yy inserts the year as two digits and adds a zero in cases of values lower than 10.

yyyy inserts the year.

 

The syntax for this macro when parameters are used is %[Date:<Parameter>]

 

Note that several parameters can be used in sequence in order to insert a customized date. For example, %[Date:dddd, dd MMMM yyyy] inserts the day of the week followed by the day of the month, the month name in full and the year as four digits (as detailed below). If parameters are not specified then output values revert to default, which is the date on the local machine in the format dd/MM/yyy.

 

Example

 

If the macro %[Date:dddd, dd MMMM yyyy] is added as a header to documents, then the output will be the day of the week followed by the day of the month, the month name in full and the year as four digits:

 

date.macro.example

Figure 1. Add Header and Footer Dialog Box, %[Date] Macro Example

 

Note that a range of preset date formats are provided in PDF-Tools:

 

date.macro.presets

Figure 2. Date Macro Preset Options