You are here

public function DateObject::__toString in Date 7.2

Same name and namespace in other branches
  1. 7.3 date_api/date_api.module \DateObject::__toString()
  2. 7 date_api/date_api.module \DateObject::__toString()

Returns the date object as a string.

Return value

string The date object formatted as a string.

File

date_api/date_api.module, line 203
This module will make the date API available to other modules.

Class

DateObject
Extend PHP DateTime class.

Code

public function __toString() {
  return $this
    ->format(DATE_FORMAT_DATETIME) . ' ' . $this
    ->getTimeZone()
    ->getName();
}