function setUp() { $this->culture = CultureInfo::getInvariantCulture(); }
/** * Gets the default NumberFormatInfo that is culture-independent * (invariant). * @return NumberFormatInfo default NumberFormatInfo. */ public static function getInvariantInfo($type = NumberFormatInfo::DECIMAL) { static $invariant; if ($invariant === null) { $culture = CultureInfo::getInvariantCulture(); $invariant = $culture->NumberFormat; $invariant->setPattern($type); } return $invariant; }
/** * Returns the DateTimeFormatInfo associated with the specified culture. * @param CultureInfo the culture that gets the DateTimeFormat property. * @return DateTimeFormatInfo DateTimeFormatInfo for the specified * culture. */ function getInstance($culture = null) { if ($culture instanceof CultureInfo) { return $culture->DateTimeFormat; } else { if (is_string($culture)) { $cultureInfo = new CultureInfo($culture); return $cultureInfo->DateTimeFormat; } else { $cultureInfo = CultureInfo::getInvariantCulture(); return $cultureInfo->DateTimeFormat; } } }