20 years PhraseExpress - Major new version 16.1 out now!
Date and time
This macro function outputs the time and/or date in specific format and with an optional time shift:
- 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".
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":
|d||Day without a leading zero (1-31)|
|dd||Day including a leading zero (01-31)|
|ddd||Abbreviated weekday (Sun-Sat)|
|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)|
|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|
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:
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).
Time stamps can be rounded to the quarter, half and full hour.
A date can be passed via parameterto perform date-/timeshift 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.