Edit this page on GitHub

Home > docs > plugins > Datetime Task

Datetime Task

The datetime task provides methods to populate the current date at the time the flow runs.

The task is provided automatically by Concord and does not require any external dependencies.

Usage

The current date as a java.util.Date object:

${datetime.current()} 

The current date as a formatted string with a pattern:

${datetime.current('pattern')} 

An example of this is as follows. Pattern syntax should follow standard java date patterns.

${datetime.current('dd.MM.yyy')}

The current date formatted into a date/time string:

${datetime.format(datetime, 'pattern')} 

Parse dateStr string to java.util.Date object:

${datetime.parse(dateStr, 'pattern')}