bool CDatabase::IsDate( string date, string format=false, string site=false, string type="SHORT" )
The method IsDate checks the date for validity.
Parameter | Description |
---|---|
date | Date to be verified. |
format | Date format. If false, the date format is inferred from the current site (for public section) or language (for administrative section). Optional; "false" by default. |
site | Site ID (for public section) or the language ID (for administrative section). Used to determine the format if format is false. Optional; by default, current site (for public section) or language (for administrative section) are used. |
type | Type of the date format: "FULL" - date and time, "SHORT" - date only. Optional; "SHORT" by default. |
Returns true if the date is valid or false otherwise.
<? if (!$DB->IsDate("12.10.2005 22:34:15", "DD.MM.YYYY HH:MI:SS")) echo "Error: invalid date format."; ?>
© 2001-2005 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |