Show/Hide Toolbars

 PhraseExpander 5 Manual

Navigation: Designing templates > Macros > Data

Date/Time

Scroll Prev Top Next More

Insert the current date/time or a specific date with a specific format.

 

The date/time macro window

The date/time macro window

 

You can choose the date format from the list or enter your own, choosing a custom date format.

You can also insert a date in the past or the future, using Use specific date or choosing the desired options in Date/Time shift

 

Syntax

{#date format -[shift][fixed][ci]#}

format: the date/time format. See date format for a list of supported date formatting.

[shift]: shifts the dates forward and backward by the specified number of years, months, weeks or days. You can also shift the time by the hour or minute. By using the day of the week shift, you can select the next or previous day of the week (for example, you can select next Tuesday or the 2nd Wednesday starting from today)

[fixed]: if a fixed date is used, it's specified here, using the YYYY-MM-dd format. This can be used with a fill-in variable to request data from the user when the template is executed.

[ci]: indicates the locale you want to use.

 

 

Examples

assuming that today is the 19th of June 2019

Template:

{#date d -[shift=+1Tue]#}

 

Result:

6/19/2019
Returns the first Tuesday, starting from the current date

Template:

{#date d#}

 

Result:

6/19/2019

 

 

Template:

{#date d-MMM-yyyy -[shift=+1M-1d]#}

 

Result:

20-Juk-2019

 

 

Template:

{#date d-MMM-yyyy -[shift=+1d][fixed=2019-03-22]#}

 

Result:

22-Mar-2019

Created with Help & Manual 7 and styled with Premium Pack Version 3 © by EC Software