How can I set only time in NSDate variable?

前端 未结 3 2273
执笔经年
执笔经年 2021-02-14 15:20

I have NSDate variable and would like to change only time (date shouldn\'t be changed). Is it possible ?

Eg: user pick date interval in DatePicker date (If it\'s start d

3条回答
  •  感动是毒
    2021-02-14 15:47

    When I only need to track the time, I don't use NSDate or NSTimeInterval. Instead I use an NSinteger and store the "military" time, ie 0830 = 8:30 AM, 14:15 = 2:15 PM.

提交回复
热议问题