Configure UIDatePicker with current locations time
Posted
by
Telkitty
on Stack Overflow
See other posts from Stack Overflow
or by Telkitty
Published on 2012-11-09T04:33:12Z
Indexed on
2012/11/09
5:00 UTC
Read the original article
Hit count: 111
I am using UIDatePicker in my current app, here is how I set a UILabel with the date time string obtained from the UIDatePicker.
-(IBAction)AddTimeEnd:(id)sender
{
NSDate * date = [m_DateTimePicker date];
m_DateTimeLabel.text = [date description];
}
Somehow the time I have entered (EST) kept on getting converted to US time in the UILabel. Does anyone know how to fix it? I would like the time entered in UIDatePicker to be consistent with the text in the label (probably the simplest way is set the locale for the UIDatePicker to be the local timezone)?
© Stack Overflow or respective owner