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".
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":
Unit | Meaning |
---|---|
d | Day without a leading zero (1-31) |
dd | Day including a leading zero (01-31) |
ddd | Abbreviated weekday (Sun-Sat) |
dddd | Weekday (Sunday-Saturday) |
dddddd | Date in standard format |
m | Month without a leading zero (1-12). If the following parameter is h or hh, then the minute is being displayed instead of the month |
mm | Month including a leading zero (01-12). If the following parameter is h or hh, then the minute is being displayed instead of the month |
mmm | Abbreviated month (Jan-Dec) |
mmmm | Month (January-December) |
yy | Year with two digits (00-99) |
yyyy | Year with four digits (0000-9999) |
h | Hour without a leading zero (0-23) |
hh | Hour including a leading zero (00-23) |
n | Minute without a leading zero (0-59) |
nn | Minute including a leading zero (00-59) |
s | Second without a leading zero (0-59) |
ss | Second including a leading zero (00-59) |
am/pm | 12-hour time prefix am or pm |
Region
PhraseExpress uses the language as configured in the Windows OS regional settings to output date information such as "Monday" or "July".
The macro parameter "Region" allows you to specify the language:
Time shift
A date and/or time shift can be added to the current time and date, for example to output a payment term (e.g. 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
to perform date-/timeshift calculations.Date calculations
The date calculation macro calculates the number of days, work days (Mo-Fr or Mo-Sa), weeks, months and years between two dates:
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.
Time calculations
The time calculation macro calculates the time between two times:
If you leave either date input empty, the current time will be used.
The time formatting must match the time formatting currently configured in the operating system's regional settings.
Example for the US: 01/16/2019
Example for Europe: 16.01.2019