/** * * Check if a value validates against the 'timestamp' data type. * * @static * * @access public * * @param mixed $value The value to validate. * * @return boolean True if the value is valid for the data type, false * if not. * */ function isTimestamp($value) { // yyyy-mm-dd hh:ii:ss // 0123456789012345678 $date = substr($value, 0, 10); $sep = substr($value, 10, 1); $time = substr($value, 11, 8); if (strlen($value) != 19 || $sep != ' ' || !DB_Table_Valid::isDate($date) || !DB_Table_Valid::isTime($time)) { return false; } else { return true; } }