Use standard en-US date and time value to do Date time parse : Calendar I18N « Date Time « C# / CSharp Tutorial






using System;
using System.Globalization;

public class DateTimeParser
{
   public static void Main()
   {


      DateTime dateValue;
      string dateString = "2/16/2010 12:15:12 PM";
      try {
         dateValue = DateTime.Parse(dateString);
         Console.WriteLine("'{0}' converted to {1}.", dateString, dateValue);
      }   
      catch (FormatException) {
         Console.WriteLine("Unable to convert '{0}'.", dateString);
      }

   }
}








13.8.Calendar I18N
13.8.1.Gets the Calendar instance associated with a CultureInfo.
13.8.2.Samples JulianCalendar
13.8.3.IsLeapMonth() for KoreanCalendar
13.8.4.Creates and initializes a JulianCalendar
13.8.5.Use standard en-US date and time value to do Date time parse
13.8.6.Displays the value of the CurrentEra property with GregorianCalendar.CurrentEra
13.8.7.Samples ThaiBuddhistCalendar
13.8.8.Gets the Calendar instance associated with a CultureInfo
13.8.9.Parse a date with CultureInfo
13.8.10.GetWeekOfYear varies depending on the FirstDayOfWeek and the CalendarWeekRule used.
13.8.11.Call GetDaysInMonth for the second month in each of five years in each era.
13.8.12.For each calendar, displays the current year, the number of months in that year, and the number of days in each month of that year.