Format DateTime in various Culture Settings - CSharp Language Basics

CSharp examples for Language Basics:Date Time

Description

Format DateTime in various Culture Settings

Demo Code

using System;/*from   w w  w . ja  v  a 2  s.c  o m*/
using System.ComponentModel;
using System.Globalization;
class BirthdayInAllCultures
{
   static void Main()
   {
      var cultures = CultureInfo.GetCultures(CultureTypes.AllCultures);
      var birthDate = new DateTime(1976, 6, 19);
      foreach (var culture in cultures)
      {
         string text = string.Format(culture, "{0,-15} {1,12:d}", culture.Name, birthDate);
         Console.WriteLine(text);
      }
   }
}

Result


Related Tutorials