date format yyyy-MM-ddTHH:mm:ssZ

后端 未结 9 2236
走了就别回头了
走了就别回头了 2020-11-28 04:49

I assume this should be pretty simple, but could not get it :(. In this format Z is time zone.
T is long time pattern
How could I get a date in this format excep

9条回答
  •  感情败类
    2020-11-28 05:11

    In C# 6+ you can use string interpolation and make this more terse:

    $"{DateTime.UtcNow:s}Z"
    

提交回复
热议问题