0

Possible Duplicate:
NSDateComponents of an NSDate

I have set up two UIDatePickers in InterfaceBuilder: one of them has it's mode set to "Date", and the other one's mode is set to "Time".

I have successfully taken the date from the "Date" picker in my ViewController, but it comes with a time...

My question is: how can I use both pickers to get a single date?

the "Date" picker and the "Time" picker

(for those of you wondering why I'm not using the "Date and Time" mode: this wouldn't make it easy for a user to select a year)

Many thanks,

Community
  • 1
  • 1
Max Chuquimia
  • 7,494
  • 2
  • 40
  • 59
  • Someone may find useful, http://stackoverflow.com/questions/14597500/how-to-combine-date-and-time-from-two-uidatepickers – Mohd Asim Feb 15 '16 at 13:25

1 Answers1

2

Look at the documentation for NSDate and NSDateComponents.

http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/DatesAndTimes/Articles/dtCalendars.html#//apple_ref/doc/uid/TP40003470

matt
  • 515,959
  • 87
  • 875
  • 1,141