You are here

public function DatexObject::toArray in Datex 7.2

Same name and namespace in other branches
  1. 7 datex_api/datex_api_classes.inc \DatexObject::toArray()

Returns this date object granularities, put in an array.

File

datex_api/datex_api.class.inc, line 394
Provides an API to work with dates.

Class

DatexObject
Base class for localized DateTime.

Code

public function toArray() {
  return array(
    'year' => $this
      ->format('Y'),
    'month' => $this
      ->format('n'),
    'day' => $this
      ->format('j'),
    'hour' => $this
      ->format('H'),
    'minute' => $this
      ->format('i'),
    'second' => $this
      ->format('s'),
    'timezone' => $this
      ->format('e'),
  );
}