输出日期格式是:美国时间 :Tue Oct 22 xxxx 00:00:00 GMT+0800
第一种:
string strDate = "Mon Aug 15 2011 00:00:00 GMT+0800";
DateTime date = DateTime.ParseExact(strDate, @"ddd MMM dd yyyy HH:mm:ss GMT+ffff", CultureInfo.CreateSpecificCulture("en-US"));
DateTime date = DateTime.ParseExact(strDate, @"ddd MMM dd yyyy HH:mm:ss GMT+ffff", CultureInfo.CreateSpecificCulture("en-US"));
Response.Write(date.ToString());
第二种:
String str = "Mon Aug 08 00:00:03 GMT+08:00";
DateFormat df = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL);
Date date;
System.out.println(new Date(str));
String ds = df.format(new Date(str));
System.out.println(ds);
DateFormat df = DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL);
Date date;
System.out.println(new Date(str));
String ds = df.format(new Date(str));
System.out.println(ds);
注:
DateFormat是枚举