Unify and manage your data

DVF date functions

Learn about the date functions used in a data validation.

Use date functions in Data Validation Functions to validate attributes that have a date format of YYYY-MM-DD.

Table 1. Date Functions
FunctionDescriptionSample
rangeThe validation function checks that the attribute value is between the two static dates. If the validation is met, then the appropriate validation message is displayed.
range(attributes.DoJ.value,'1980-01-01','2019-12-31')
equalsThe validation function checks that the attribute value matches the given static date or another date attribute value exactly. If the validation is met, then the appropriate validation message is displayed.

This function supports the NOT conditional operator.

equals(attributes.DoJ.value,'2019-02-16')
equals(attributes.DoB.value,attributes.DoD.value)
gtThe validation function checks that the attribute value is greater than the given static date or another date attribute value. If the validation is met, then the appropriate validation message is displayed.

This function supports the NOT conditional operator.

gt(attributes.DoJ.value,'2019-01-01')
gt(attributes.DoB.value,attribute.DoD.value) 
gteThe validation function checks that the attribute value is greater than or equal to the given static date or another date attribute value. If the validation is met then the appropriate validation message is displayed.

This function supports the NOT conditional operator.

gte(attributes.DoJ.value,'2019-01-01')
gte(attributes.DoB.value,attribute.DoD.value)
ltThe validation function checks that the attribute value is lesser than the given static date or another date attribute value. If the validation is met then the appropriate validation message is displayed.

This function supports the NOT conditional operator.

lt(attributes.DoJ.value,'2019-01-01')
lt(attributes.DOB.value, attributes.DOD.value)
lteThe validation function checks that the attribute value is lesser than or equal to the given static date or another date attribute value. If the validation is met, then the appropriate validation message is displayed.

This function supports the NOT conditional operator.

lte(attributes.DoJ.value,'2019-01-01')
lte(attributes.DOB.value, attributes.DOD.value)                        
existsThe validation function checks that the given attribute value exists. If the validation is met, then the appropriate validation message is displayed.
exists(attributes.DoJ.value)
missingThe validation function checks that the given attribute value is missing. If the validation is met, then the appropriate validation message is displayed.
missing(attributes.DoJ.value)
relative date comparisionsThe validation function checks that the attribute value is within a relative date, in days, to the current date. For example, check if the DOB value is less than 1 day from the current date when validated.

During validation, the current date is compared against relative dates in the Coordinated Universal Time (UTC) timezone. See the section below for more details.

Note: For DVFs created with the Validate event field set to Create & Update profile or Update profile we recommend you only use the gte function.

For DVFs created with the Validate event field set to Create profile, we recommend you only use the ltfunction.

lt(attributes.DOB, '-P1D')

Relative dates comparison to UTC timezone

The date and timestamp fields are compared against relative dates in the Coordinated Universal Time (UTC) timezone.

When entering a date, there may be an anomaly when it compares the user's date (who is in a different timezone) to the UTC timezone. Here's an example.

Timezone A is 8 hours ahead the UTC timezone. A user in timezone A enters the current date as the 30th September at 4am. However, as per UTC, the current date is 29th of September at 8pm. During validation, the system infers the current date as 29th (as per the UTC timezone) and throws an error.

Timestamps, however, do not have such anomalies since the Timestamp field type is stored and compared in UTC only. System dates for entities, such as Start Date and End Date, are stored as timestamps and hence, will not face such anomalies.