Initialize a NSDate object with a specific time

后端 未结 5 1893
一整个雨季
一整个雨季 2021-02-14 11:17

I have time in string format for example 2:00. I want to initialize it to NSDate with present date. I tried doin

5条回答
  •  青春惊慌失措
    2021-02-14 11:49

    You need to use an NSCalendar object to convert NSDateComponents to an NSDate. See Apple's documentation on Creating a Date from Components.

提交回复
热议问题