Checking validity of date value
Added by Anonymous over 19 years ago
Legacy ID: #3121156 Legacy Poster: Anantha Krishnan (coolkrishnan)
How do I make sure that a date literal is in proper format before passing it to functions such as "fn:adjust-dateTime-to-timezone" ? Such functions throw an exception if the value does not confirm to a valid date literal. I need a graceful way of finding out if the value is in incorrect format so that I can proceed without calling the function. thanks, ananth
Replies (2)
RE: Checking validity of date value - Added by Anonymous over 19 years ago
Legacy ID: #3121239 Legacy Poster: Michael Kay (mhkay)
This is exactly what the "castable as" operator is for: if ($input castable as xs:dateTime) then adjust-dateTime-to-timezone(xs:dateTime($input)) else f:fofl() Michael Kay
RE: Checking validity of date value - Added by Anonymous over 19 years ago
Legacy ID: #3123060 Legacy Poster: Anantha Krishnan (coolkrishnan)
Thanks ! ananth
Please register to reply