示例#1
0
 /**
  * Converts Julian Day Count to Gregorian date.
  *
  * Shim implementation of \JDToGregorian()
  *
  * @link https://php.net/JDToGregorian
  *
  * @param int $julianday A Julian Day number
  *
  * @return string A string of the form "month/day/year"
  */
 public static function jdToGregorian($julianday)
 {
     $gregorian = new GregorianCalendar();
     $cal = $gregorian->calFromJd($julianday);
     return $cal['date'];
 }
 /**
  * Initializes the 100-year window that dates with 2-digit years are 
  * considered to fall within so that its start date is 80 years before the 
  * current time.
  * 
  * @author     Dominik del Bondio <*****@*****.**>
  * @author     The ICU Project
  * @since      0.11.0
  */
 private static function initializeSystemDefaultCentury()
 {
     // initialize systemDefaultCentury and systemDefaultCenturyYear based
     // on the current time.  They'll be set to 80 years before
     // the current time.
     // No point in locking as it should be idempotent.
     if (self::$fgSystemDefaultCenturyStart == self::$fgSystemDefaultCentury) {
         $calendar = new GregorianCalendar();
         $calendar->setTime(AgaviCalendar::getNow());
         $calendar->add(AgaviDateDefinitions::YEAR, -80);
         $newStart = $calendar->getTime();
         $newYear = $calendar->get(AgaviDateDefinitions::YEAR);
         self::$fgSystemDefaultCenturyStart = $newStart;
         self::$fgSystemDefaultCenturyStartYear = $newYear;
     }
 }