/** * Checks if a given date is valid. * * \param $date * Any date-like object; this could be a string, timestamp or * a AnewtDateTimeAtom instance. * * \return * True if this is a valid date, false otherwise. */ static function is_valid($date) { assert('$date instanceof AnewtDateTimeAtom;'); return AnewtDateTime::is_valid_date_ymd(AnewtDateTime::year($date), AnewtDateTime::month($date), AnewtDateTime::day($date)) && AnewtDateTime::is_valid_time_hms(AnewtDateTime::hour($date), AnewtDateTime::minute($date), AnewtDateTime::second($date)); }