I was trying to resolve a problem a couple of days ago and I found the CDATE logic command behaving differently than I expected. I think I've always assumed that CDATE($stringdate [, $mask]) would return zero unless $stringdate was a valid date in the format specified by mask. The code I was investigating certainly presumed that since it took a non-zero numeric returned by CDATE to mean the string date argument was valid.
However, in fact it seems CDATE is pretty lax about the validation of dates in string format, for example:
CDATE("2005-11-1", "YYYY-MM-DD") gives 75189 not 0 and, worse, that value represents the 10th November.
CDATE("2005-10-1.", "YYYY-MM-DD") gives 75172 which is the value for the 24th October (ie. totally spurious).
In fact all kinds of odd characters work in addition to digits within the month and day parts. With my C programmer hat on I'd guess ProIV is simply masking off high bits of those characters and not actually checking they are digits..
Hope this info saves someone else some time <_<
Edited by Richard Bassett, 15 November 2005 - 07:08 PM.