You are here

public static function DatexGregorian::convert in Datex 7.2

Methos responsible for converting Gregorian date to localized date.

Return value

array Array containing converted date, Array should be indexed from 0 to 7 in this order: year, month, day, hour, minute, month, day of year (number of days passed since day 1 of that year), day of week. Day of week MUST be from 1 to 7.

Overrides DatexCalendarIterface::convert

File

datex_api/DatexGregorian.inc, line 14
Gregorian for datex. Nothinf special, always calls DateTime methods to handle stuff.

Class

DatexGregorian
Default Gregorian for datex.

Code

public static function convert($timestamp) {
  $date = new DateTime('@' . $timestamp);
  return array(
    $date
      ->format('Y'),
    $date
      ->format('m'),
    $date
      ->format('n'),
    $date
      ->format('j'),
    $date
      ->format('H'),
    $date
      ->format('i'),
    $date
      ->format('s'),
    $date
      ->format('z'),
    $date
      ->format('w'),
  );
}