【发布时间】:2013-11-21 12:08:12
【问题描述】:
我是 xcode 新手,请看下面的代码和链接 enter link description here
{
NSString * TempDate = [NSString stringWithFormat:@"%@ %@ %@",Datelbl.text,yearString,TimeLbl.text]; //Thursday, November 21 2013 5:35 PM
[dateFormatter setLocale:[NSLocale currentLocale]];
[dateFormatter setDateFormat :@"EEEE',' MMMM d yyyy hh:mm a"];
AppointmentDate = [dateFormatter dateFromString:TempDate]; //NSDate
Appointment = [dateFormatter stringFromDate:AppointmentDate]; //NSString
}
这里,约会日期返回这个值 -> 2013-11-21 12:05:00 +0000, 约会返回此值-> 2013 年 11 月 21 日星期四下午 5:35。
我需要得到 2013-11-21 05.35 PM。那么,如何管理这个 GMT 问题。
【问题讨论】:
-
TempDate 是什么样的?
-
@ramdy:请将您之前的问题与此链接,这将对您有所帮助。
标签: ios objective-c nsdate nsdateformatter