toDateOnly

Last update: 2025-04-07
  • Created for:
  • Experienced
    Developer

Converts an argument into a dateOnly type value. To learn more about data types, refer to this section.

Category

Conversion

Function syntax

toDateOnly(<parameters>)

Parameters

Parameter Type
String representation of a date as “YYYY-MM-DD” (XDM format). Also supports ISO-8601 format: only full-date part is considered (Refer to RFC 3339, section 5.6 string
date time dateTime
date time without time zone dateTimeOnly
integer value of an epoch in milliseconds integer

Signatures and returned types

toDateOnly(<dateTime>)

toDateOnly(<dateTimeOnly>)

toDateOnly(<string>)

toDateOnly(<integer>, <integer>, <integer>)

Returns a dateOnly type value.

Examples

toDateOnly("2023-08-18")

toDateOnly("2023-08-18T00:00:00.000Z")

toDateOnly("2023-08-18T00:00:00")

all return a dateOnly object representing 2023-08-18.

toDateOnly(#{ExperiencePlatform.ProfileFieldGroup.person.birthDate})

Returns a dateOnly.

On this page