How do I format JSON Date String with Swift?

后端 未结 5 1667
Happy的楠姐
Happy的楠姐 2020-12-29 06:55

I make an http get request to a server and get back a json object with a date string like this:

{
    name = \"Place1\";
    temperature = 79;
    humidity =         


        
5条回答
  •  梦毁少年i
    2020-12-29 07:29

    Use the following string format to convert a server string into a Date

    dateFor.dateFormat = "yyyy-MM-dd'T'HH:mm:ss"
    

提交回复
热议问题