Date and time

This macro function outputs the time and/or date in specific format and with an optional time shift.

Applications:
  • Output the current time or date in specified format and language.
  • Output specific parts of a date or time, e.g. the current month's name or the day of the week.
  • Output of a shifted date or time, e.g. next month, the current time plus three hours or any given date plus 14 (work) days. This may be versatile for invoice reminder boilerplate templates or out-of-office notifications.
  • Output of the rounded time, e.g. "11:45am" instead of "11:39am".

Date and time stamp

Formatting

Pick one of the presets on the left or define the desired formatting by entering one or more of following shortcuts in the input field "Format":

UnitMeaning
dDay without a leading zero (1-31)
ddDay including a leading zero (01-31)
dddAbbreviated weekday (Sun-Sat)
ddddWeekday (Sunday-Saturday)
ddddddDate in standard format
mMonth without a leading zero (1-12). If the following parameter is h or hh, then the minute is being displayed instead of the month
mmMonth including a leading zero (01-12). If the following parameter is h or hh, then the minute is being displayed instead of the month
mmmAbbreviated month (Jan-Dec)
mmmmMonth (January-December)
yyYear with two digits (00-99)
yyyyYear with four digits (0000-9999)
hHour without a leading zero (0-23)
hhHour including a leading zero (00-23)
nMinute without a leading zero (0-59)
nnMinute including a leading zero (00-59)
sSecond without a leading zero (0-59)
ssSecond including a leading zero (00-59)
am/pm12-hour time prefix am or pm

Locale

PhraseExpress uses the language as configured in the OS regional settings to output date information such as "Monday" or "July".

The macro parameter "Region" allows you to specify another language:

pex14_date_language.png

Time shift

A date and/or time shift can be added to the current time and date, for example to output a payment term (current date plus 14 days).

Rounding

Time stamps can be rounded to the quarter, half and full hour.

Date processing

A date can be passed via parameter Value to perform date-/timeshift calculations or to change formatting.

Date calculations

The date calculation macro allows you to calculate the number of days, work days (Mo-Fr or Mo-Sa), weeks, months and years between two dates:

Date calculation

If you leave either date input empty, the current date will be used.

The date formatting must match the date formatting currently configured in the operating system's regional settings.

Example for the US: 01/16/2019

Example for Europe: 16.01.2019

Each month has 30.4375 days. Months are rounded in whole numbers.

Table of Contents


Table of Contents