You are here

public static function DatexGregorian::toGregorian in Datex 7.2

Opposite of DatexCalendarIterface::convert().

Overrides DatexCalendarIterface::toGregorian

File

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

Class

DatexGregorian
Default Gregorian for datex.

Code

public static function toGregorian($year = 0, $month = 0, $day = 0) {
  $date = new DateTime();
  if (!$year) {
    $year = $date
      ->format('Y');
  }
  if (!$month) {
    $month = $date
      ->format('n');
  }
  if (!$day) {
    $day = $date
      ->format('j');
  }
  return array(
    $year,
    $month,
    $day,
  );
}