Format Date as “yyyy-MM-dd'T'HH:mm:ss.SSS'Z'”

后端 未结 5 559
囚心锁ツ
囚心锁ツ 2021-02-02 05:49

I need to format a date as yyyy-MM-dd\'T\'HH:mm:ss.SSS\'Z\' as specified by Parse\'s REST API for Facebook. I was wondering what the most lightweight

5条回答
  •  傲寒
    傲寒 (楼主)
    2021-02-02 06:19

    You can use javax.xml.bind.DatatypeConverter class

    DatatypeConverter.printDateTime & DatatypeConverter.parseDateTime

提交回复
热议问题