/** * 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; } }