i have an NSDate object from an old date which i am getting from my DB. Now i need to set my UIDatePicker date to current date but with hour and minute value from my stored NSDate object which i have got from my DB.
So how to extract hour and minute from old date and set it to current UIDatePicker NSdate.
Thanks
Since a NSDate can’t be changed after it’s initialization, you have to recreate it:
To get the hour and minute component of the NSDate use NSCalendar:
Then you can create a new NSDate (also using NSCalendar):