Where's the DateTime 'Z' format specifier?

后端 未结 6 1421
抹茶落季
抹茶落季 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

    Maybe the "K" format specifier would be of some use. This is the only one that seems to mention the use of capital "Z".

    "Z" is kind of a unique case for DateTimes. The literal "Z" is actually part of the ISO 8601 datetime standard for UTC times. When "Z" (Zulu) is tacked on the end of a time, it indicates that that time is UTC, so really the literal Z is part of the time. This probably creates a few problems for the date format library in .NET, since it's actually a literal, rather than a format specifier.

提交回复
热议问题