getInvariantCulture() 정적인 공개 메소드

Any changes to the invariant culture affects all other instances of the invariant culture. The invariant culture is assumed to be "en";
static public getInvariantCulture ( ) : CultureInfo
리턴 CultureInfo invariant culture info is "en".
예제 #1
0
 function setUp()
 {
     $this->culture = CultureInfo::getInvariantCulture();
 }
예제 #2
0
 /**
  * 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;
 }
예제 #3
0
 /**
  * Returns the DateTimeFormatInfo associated with the specified culture.
  * @param CultureInfo the culture that gets the DateTimeFormat property.
  * @return DateTimeFormatInfo DateTimeFormatInfo for the specified
  * culture.
  */
 static function getInstance($culture = null)
 {
     if ($culture instanceof CultureInfo) {
         return $culture->getDateTimeFormat();
     } else {
         if (is_string($culture)) {
             $cultureInfo = CultureInfo::getInstance($culture);
             return $cultureInfo->getDateTimeFormat();
         } else {
             $cultureInfo = CultureInfo::getInvariantCulture();
             return $cultureInfo->getDateTimeFormat();
         }
     }
 }