Where's the DateTime 'Z' format specifier?

后端 未结 6 1449
抹茶落季
抹茶落季 2020-11-27 06:09

[Update: Format specifiers are not the same thing as format strings; a format specifier is a piece of a custom format string, where a format string is \

6条回答
  •  天涯浪人
    2020-11-27 06:34

    This page on MSDN lists standard DateTime format strings, uncluding strings using the 'Z'.

    Update: you will need to make sure that the rest of the date string follows the correct pattern as well (you have not supplied an example of what you send it, so it's hard to say whether you did or not). For the UTC format to work it should look like this:

    // yyyy'-'MM'-'dd HH':'mm':'ss'Z'
    DateTime utcTime = DateTime.Parse("2009-05-07 08:17:25Z");
    

提交回复
热议问题