date format yyyy-MM-ddTHH:mm:ssZ

后端 未结 9 2230
走了就别回头了
走了就别回头了 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 04:57

    Single Line code for this.

    var temp   =  DateTime.UtcNow.ToString("yyyy-MM-ddTHH\\:mm\\:ssZ");
    

提交回复
热议问题