I have drag and drop UIDatePicker
from InterfaceBuilder
and in .h file i have done the outlet and actions as follows.
- (IBAction)DatePicker:(id)sender;
@property (strong, nonatomic) IBOutlet UILabel *dateSelected;
@property (strong, nonatomic) IBOutlet UIDatePicker *datePickerOutlet;
and in appDelegate.m file i have assigned the following parameters to the datePickerOutlet
datePickerOutlet.calendar=[NSCalendar autoupdatingCurrentCalendar];
datePickerOutlet.timeZone=[NSTimeZone defaultTimeZone];
but it is giving time as follows through NSLog
2012-09-03 15:42:45.365 DataTest[4213:207] 2012-09-03 10:10:28 +0000
2012-09-03 15:42:45.366 DataTest[4213:207] Asia/Kolkata
it should give output as
2012-09-03 15:42:45.365 DataTest[4213:207] 2012-09-03 3:42:45 +0000
2012-09-03 15:42:45.366 DataTest[4213:207] Asia/Kolkata
(which is the current time)
How to get the current time??in the picker it is showing correctly but when i select a date NSLog is giving other value..