Nsdateformatter + Timezone issue

前端 未结 2 757
故里飘歌
故里飘歌 2020-12-18 15:43

I am trying to parse this date timestamp Begin to string:

Wed, 11 Sep 2013 08:51:41 EEST

This issue with only

2条回答
  •  天涯浪人
    2020-12-18 16:25

    Try this instead:

    NSString *beginString = @"Wed, 11 Sep 2013 08:51:41 EEST";
    NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
    [dateFormat setLocale:[[NSLocale alloc] initWithLocaleIdentifier:@"en-GB"]];
    [dateFormat setDateFormat:@"EEE, dd MMM yyyy HH:mm:ss zzz"];
    NSDate *dateFromString = [dateFormat dateFromString:beginString];
    

    See details & explanation here

提交回复
热议问题