IsDateTimeFormat

Summary

The IsDateTimeFormat function verifies if the given input string conforms to the given date time formatting mask. IsDateTimeFormat does not check the data type of the given value. Use TypeNameOfinstead.

Syntax

IsDateTimeFormat(<string>, <format_mask>)

Return Type

Boolean

Details

Connect uses Java 8 formatting masks. Find more information regarding formatting masks here: https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html

The examples below show some more commonly used masks (and obscure examples, too!). You might use this function to scan “date” columns included in source CSV files for invalid date formats.

Examples

eval IsDateTimeFormat(‘1976-07-04′,’yyyy-MM-dd’);

screen-shot-2016-10-18-at-10-02-55-am

eval IsDateTimeFormat(‘1976-07-04′,’yyyy/MM/dd’);

screen-shot-2016-10-18-at-10-03-36-am

eval IsDateTimeFormat(‘2014-07-23T09:26:44′,’yyyy-MM-dd”T”HH:mm:ss’);

screen-shot-2016-10-18-at-10-02-55-am

eval IsDateTimeFormat(‘April 1, 1929’, ‘MMMM d, yyyy’);

screen-shot-2016-10-18-at-10-02-55-am

eval IsDateTimeFormat(‘April 01, 1929’, ‘MMM dd, yyyy’);

screen-shot-2016-10-18-at-10-03-36-am

eval IsDateTimeFormat(‘April 11, 1929’, ‘MMMM d, yyyy’);

screen-shot-2016-10-18-at-10-02-55-am

eval IsDateTimeFormat(‘September 22, 2016 Thursday 03:24:29 +03:00’, ‘MMMM dd, yyyy EEEE HH:mm:ss XXXXX’);

screen-shot-2016-10-18-at-10-02-55-am

 

Related Functions

FormatDateTime

ToDate

ToDateTime

ToOffsetDateTime

ToZonedDateTime

TypeNameOf