public function getDate($format = 'Y-m-d H:i:s') { if ($format) { if ($this->date) { return date($format, strtotime($this->date)); } } else { return $this->date; } }