我是新來的Xcode,請參見下面的代碼,並鏈接 enter link description herenslocale問題迄今
{
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
}
這裏,appointmentDate返回該值 - > 2013年11月21日12:05:00 +0000, 約會返回此值 - > 2013年11月21日星期四下午05:35。
我需要2013-11-21 05.35 PM。那麼,如何管理這個GMT問題。
TempDate是什麼樣子? –
@ramdy:Plz把你之前的問題與這個聯繫起來,那對你有幫助。 –