I have two text, one in Hebrew language and one in English.
In first text I have date that is in Hebrew.
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
NSLocale *hebrew = [[NSLocale alloc] initWithLocaleIdentifier:@"he_IL"]; // Hebrew
[dateFormatter setDateFormat:@"yyyy-MM-dd'T'hh:mm:ss.SSSZ"];
NSDate *date = [dateFormatter dateFromString:model.startDate];
NSLog(@"%@", date);
[dateFormatter setDateFormat:@"EEEE,dd.MM.yyyy"];
dateFormatter.locale = hebrew;
NSString *strDate = [dateFormatter stringFromDate:date];
and start Date is : ??? ????,19.08.2016 in NString object strDate
On other hand I have text 07: 00-16: 00 in NSString object timeForRequest
My needed format is ??? ???, 15.01.2016 | 16:00 - 07:00
and when I try to do same with following code
[NSString stringWithFormat:@"%@ | %@",strDate,timeForRequest]
it shows me like this :??? ????,19.08.2016 | 07: 00-16: 00
Observe the time is not correct, please help me to come out from this wired situation.
Thanks in advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…