public static string GetDatetime()
{
System.Globalization.DateTimeFormatInfo myDTFI = new System.Globalization.CultureInfo("en-US", false).DateTimeFormat;
DateTime str = DateTime.Now;
return str.ToString("MMMM dd, yyyy h:mm:ss tt", myDTFI);
}
输出结果:
October 16, 2014 2:48:04 PM
如果需要星期几的话就改成格式
"dddd,MMMM dd, yyyy h:mm:ss tt"