You are here

public function DatexObject::toArray in Datex 7

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

Returns date granularities put in an array.

Return value

array Date granularities put in an array.

File

datex_api/datex_api_classes.inc, line 869
API and helper functions used by other datex modules.

Class

DatexObject
This class is Jalali equivilant of php DateTime. It also has some functionallity from object defiend in Drupal's date module DateObject.

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'),
  );
}