IsDate
Determine whether a given value is a date object or a date string.
Method Signature
IsDate(date=[any], locale=[string], timezone=[string])
Arguments
Argument
Type
Required
Description
Default
date
any
true
Value to test for date-ness
locale
string
false
Optional ISO locale string to use for parsing the date/time string.
timezone
string
false
Optional timezone to use for parsing the date/time string.
Examples
Simple example
To determine whether a string can be converted to a date/time value.
<bx:set Date = isNumericDate( now() ) >
<bx:output>#Date#</bx:output>
Result: Yes
Simple example
To determine whether a string can be converted to a date/time value.
<bx:set result = isNumericDate( "Monday" ) >
<bx:output>#result#</bx:output>
Result: No
Additional Examples
writeDump( label="Single numeric value", var=isNumericDate( 1 ) );
writeDump( label="Integer value", var=isNumericDate( 1000000000 ) );
writeDump( label="Now()", var=isNumericDate( now() ) );
writeDump( label="Date value", var=isNumericDate( "01/01/04" ) );
writeDump( label="Minus value", var=isNumericDate( "-1111111111" ) );
writeDump( label="String value", var=isNumericDate( "efsdf" ) );
Related
Last updated
Was this helpful?