DATE ()

DATE ()

DATE(date, [format])

Extracts and formats the date part of a string representing a date (which can contain also the time part)

The parameter FORMAT allows to specify formatting options for the value returned

Input Parameters

Parameter

Type

Default

Required

Description

Parameter

Type

Default

Required

Description

date

Date

 

Yes

 

 

format

String

Y-M-D

No

The desired format of the date returned can include the following constants:

  • Y: Show the year with 4 digits

  • y: Show the year with 2 digits

  • M: Show the month with 2 digits

  • m: Show the month with 1 digit

  • D: Show the day with 2 digits

  • d: Show the day with one digit

The FORMAT parameter can contain other texts apart from the predefined constants.For example (“Date is d/m/Y”)

Execution

Always. Calculated on-the-fly whenever an ITEM of a FORM is changed (by means of form_set_answer(), or when the FORM is opened

Examples

Formula

Description

Formula

Description

DATE(“2021-09-01 12:34:21“, “D/M/Y)

Returns “01/09/2021”

DATE(“2021-09-01 12:34:21“, “d-m-y)

Returns “1-9-21”

DATE(“2021-09-01 12:34:21“, “Year: Y”)

Returns “Year: 2021”