0) { // timestamp is already properly formatted return $timestamp; } else { $ts = strtotime($timestamp); if ($ts === false) { require_once 'Zend/Gdata/App/InvalidArgumentException.php'; throw new Zend_Gdata_App_InvalidArgumentException("Invalid timestamp: $timestamp."); } return date('Y-m-d\TH:i:s', $ts); } } }