Culture information : Culture Format : I18N Internationalization C# Examples


C# Examples » I18N Internationalization » Culture Format »

 

Culture information









    
using  System;
using  System.Collections;
using  System.Collections.Generic;
using  System.IO;
using  System.Reflection;
using  System.Resources;
using  System.Text;
using  System.Threading;
using  System.Globalization;

public  class  MainClass
{
        public  static  void  Main()
        {
              string[]  cultures  =  new  string[]  {  "en-US",  "en-GB",  "es-MX",  "de-DE",  "ja-JP"  };

                using  (TextWriter  sw  =  Console.Out)
                {
                        foreach  (string  c  in  cultures)
                        {
                                CultureInfo  ci  =  new  CultureInfo(c);
                                DateTime  dt  =  new  DateTime(1980,  9,  12,  0,  30,  55);
                                sw.WriteLine("Short  Date  Example:  {0}",  dt.ToString(ci.DateTimeFormat.ShortDatePattern,  ci.DateTimeFormat));
                                sw.WriteLine("Long  Date  Example:  {0}",  dt.ToString(ci.DateTimeFormat.LongDatePattern,  ci.DateTimeFormat));
                        }
                }
        }
}
    
   
  
   



Output

Short Date Example: 9/12/1980
Long Date Example: Friday, September 12, 1980
Short Date Example: 12/09/1980
Long Date Example: 12 September 1980
Short Date Example: 12/09/1980
Long Date Example: viernes, 12 de septiembre de 1980
Short Date Example: 12.09.1980
Long Date Example: Freitag, 12. September 1980
Short Date Example: 1980/09/12
Long Date Example: 1980?9?12?


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo I18N Internationalization
» Culture Format