2010-03-08 4 views
6

Ich bin neu auf iPhone-Entwicklung. In meinem Eingabedatum Format ist "2010-03-05T18: 20: 40Z", und ich donno, wie man ein Eingabeformat meines Codes gibt. So habe ich in meinem Code (?) Erwähnt.Wie gebe ich ein Eingabedatum Format in iPhone

Eingabedatum format = "2010-03-05T18: 20: 40Z"

Hier ist mein Code:

NSString *indate = @"2010-03-05T18:20:40Z"; 
NSDateFormatter *inputFormatter = [[NSDateFormatter alloc] init]; 
[inputFormatter setDateFormat:@"????????????????????????"]; 

NSDate *inputDate = [inputFormatter dateFromString:indate]; 
NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init]; 
[outputFormatter setDateFormat:@"EEE. MMM. d, yyyy"]; 

NSString *outputDate = [outputFormatter stringFromDate:inputDate]; 

lDate.text = outputDate; 

Plz mir helfen.

Danke.

Antwort

Verwandte Themen