Carrot reference
Functions

date()

Converts input to Date including relative Date input.

Syntax

date(value[, date])

  • value - the value to be evaluated by the function.
    • If value is not provided, the default will be the current date.
    • Can be used as a modifier, for example "+6w" or "-5m".
  • date - (optional) a parameter to be used in conjunction with a modifier value. Typically used to specify a Date to be modified.
  • Return type: Date.

Sample usage

date() returns the current date.

date(createDate) returns the value of createDate.

date("+6w", createDate) returns a date six weeks from the value of createDate.

Supported data types

Input type

Return type

Logic

Date

Date

If a Date value is passed, the function will return the specified date, or a modified date if the date parameter is used. Default is today's date.

Unsupported data types

Null

Unsupported data types return Null.



Updated 04 Oct 2023
Doc contributor
Did this page help you?