/ Published in: Objective C
Expand |
Embed | Plain Text
NSString *strDate; //NSLog(@"%@",strDateGMT); NSRange range = [strDateGMT rangeOfString:@"GMT"]; if (range.location != NSNotFound) { [dateFormatter setDateStyle:kCFDateFormatterLongStyle]; [dateFormatter setTimeStyle:kCFDateFormatterLongStyle]; [dateFormatter release]; // NSLog(@"%@",dateGMTString); // NSLog(@"%@",dateLocalString); // %@ - 1 - For Date // %@ - 2 - For Month // %@ - 3 - For Year // %@ - 4 - For Time // %@ - 5 - For AM/PM if([ar containsObject:@"AM"] || [ar containsObject:@"PM"] ) { // if iPhone is Set without 24Hours timing Mode strDate =[NSString stringWithFormat:@"%@ %@ %@ %@ %@",[ar objectAtIndex:0],[ar objectAtIndex:1],[ar objectAtIndex:2],[ar objectAtIndex:3],[ar objectAtIndex:4]]; } else { // if iPhone is Set with 24Hours timing Mode strDate =[NSString stringWithFormat:@"%@ %@ %@ %@",[ar objectAtIndex:0],[ar objectAtIndex:1],[ar objectAtIndex:2],[ar objectAtIndex:3]]; } } else { }
You need to login to post a comment.
