如何将英文日期转换成标准的中文日期?
例如:
① Oct. 20, 2004② 10 May., 2004③ 3rd June, 2004④ Sept. 16th, 2004等
转换成YYYY-MM-DD希望大家多多指教,星期一结贴。

解决方案 »

  1.   

    DateTime dt = Convert.ToDateTime("Oct. 20, 2004");
     string result = dt.ToString("yyyy-MM-dd");
      

  2.   

    或者直接在数据库中对时间进行format也可以!!!!
      

  3.   

    System.Globalization.DateTimeFormatInfo myDTFI = new System.Globalization.CultureInfo( "en-US", false ).DateTimeFormat;//中国用zh-cn
    DateTime myDT =System.DateTime.Now;Response.Write(myDT.ToString("f"));/*
    This code produces the following output.FORMAT  en-US EXAMPLE
    CHAR    VALUE OF ASSOCIATED PROPERTY, IF ANY  d     1/3/2002
    M/d/yyyy (ShortDatePattern)  D     Thursday, January 03, 2002
    dddd, MMMM dd, yyyy (LongDatePattern)  f     Thursday, January 03, 2002 12:00 AM  F     Thursday, January 03, 2002 12:00:00 AM
    dddd, MMMM dd, yyyy h:mm:ss tt (FullDateTimePattern)  g     1/3/2002 12:00 AM  G     1/3/2002 12:00:00 AM  m     January 03
    MMMM dd (MonthDayPattern)  M     January 03
    MMMM dd (MonthDayPattern)  r     Thu, 03 Jan 2002 00:00:00 GMT
    ddd, dd MMM yyyy HH':'mm':'ss 'GMT' (RFC1123Pattern)  R     Thu, 03 Jan 2002 00:00:00 GMT
    ddd, dd MMM yyyy HH':'mm':'ss 'GMT' (RFC1123Pattern)  s     2002-01-03T00:00:00
    yyyy'-'MM'-'dd'T'HH':'mm':'ss (SortableDateTimePattern)  t     12:00 AM
    h:mm tt (ShortTimePattern)  T     12:00:00 AM
    h:mm:ss tt (LongTimePattern)  u     2002-01-03 00:00:00Z
    yyyy'-'MM'-'dd HH':'mm':'ss'Z' (UniversalSortableDateTimePattern)  U     Thursday, January 03, 2002 8:00:00 AM  y     January, 2002
    MMMM, yyyy (YearMonthPattern)  Y     January, 2002
    MMMM, yyyy (YearMonthPattern)
    */
      

  4.   

    不好意思,请假了,先谢谢大家了
    不过如果是以下这种格式呢
    "Tue,13 Dec 2005 08:13:07 + 0800"
    应该如何转换呢