public void TestMethod2()
{

// System.DateTime.ParseExact(@"Wed Oct 12 00:00:00 UTC+0800 2011",);
DateTime datetime = DateTime.Now;
IFormatProvider cur = new CultureInfo("en-US");

Console.WriteLine(DateTime.ParseExact(
@"Wed Oct 12 00:00:00 UTC+0800 2011",
"ddd MMM dd hh:mm:ss UTCzzz yyyy",
cur));

}

javascript的日期直接 toString() 返回是这种格式 "Wed Oct 12 00:00:00 UTC+0800 2011"
C#用"ddd MMM dd hh:mm:ss UTCzzz yyyy"格式可以分析出来。

不过zzz的时区格式是+08:00 而不是+0800不知道有没有问题,另外也不知道时区是不是有非整小时的。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2021-07-31
  • 2022-01-01
  • 2022-02-23
  • 2021-10-07
  • 2021-05-21
猜你喜欢
  • 2021-10-12
  • 2021-07-26
  • 2022-01-18
  • 2022-12-23
  • 2021-09-04
  • 2021-11-21
  • 2021-07-11
相关资源
相似解决方案