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 TypeNameOf
instead.
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’);
eval IsDateTimeFormat(‘1976-07-04′,’yyyy/MM/dd’);
eval IsDateTimeFormat(‘2014-07-23T09:26:44′,’yyyy-MM-dd”T”HH:mm:ss’);
eval IsDateTimeFormat(‘April 1, 1929’, ‘MMMM d, yyyy’);
eval IsDateTimeFormat(‘April 01, 1929’, ‘MMM dd, yyyy’);
eval IsDateTimeFormat(‘April 11, 1929’, ‘MMMM d, yyyy’);
eval IsDateTimeFormat(‘September 22, 2016 Thursday 03:24:29 +03:00’, ‘MMMM dd, yyyy EEEE HH:mm:ss XXXXX’);