Time

<< Click to Display Table of Contents >>

Navigation:  PDF-Tools V7 User Manual > Appendix > Macros >

Time


 

welcome.icon.pdftools Time

 


 

The Time macro inserts the current time. Multiple time formats are available, as detailed below.

 

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

 

h inserts the hour and omits the zero in cases of single-digit values.

hh inserts the hour and includes a zero in cases of single-digit values.

H inserts the hour, includes a zero in cases of single-digit values and uses a 24 hour-clock.

m inserts the minutes and omits the zero in cases of single-digit values.

mm inserts the minutes and includes a zero in cases of single-digit values.

s inserts the seconds and omits the zero in cases of single-digit values.

ss inserts the seconds and includes a zero in cases single-digit values.

t inserts a single character to reference the a.m./p.m. variable: a or p.

tt inserts two characters to reference the a.m/p.m. variable: am or pm.

 

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

 

Note that several parameters can be used in sequence in order to insert a customized time. For example, %[Time:H:mm tt] inserts the current hour and minutes, and inserts two characters to reference the a.m./p.m. variable, as detailed below.

 

Example

 

If the macro %[Time:H:mm tt] is used to specify watermark text, then the current hour and minutes, and two characters to reference the a.m./p.m. variable, are inserted as a watermark:

 

time.macro.example

Figure 1. Add Watermark Dialog Box, %[Time] Macro Example

 

Note that this macro is often used in conjunction with other macros in order to create combined output. For example the combined macros %[Time:H:mm] %[Month]/%[Day] output the current time followed by the month and the day of the month:

 

time.macro.example.two

Figure 2. %[Time] Combined Macro Example