unexpected result of dateFromComponents:

后端 未结 3 1225
清酒与你
清酒与你 2021-01-21 11:51

the following code

NSCalendar *cal = [NSCalendar currentCalendar];
[cal setFirstWeekday:2];
[cal setMinimumDaysInFirstWeek:4];

NSDateComponents *comp = [[NSDate         


        
3条回答
  •  执念已碎
    2021-01-21 12:29

    set timezone

    NSCalendar *cal = [NSCalendar currentCalendar];
    
    [cal setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"GMT"]];
    

提交回复
热议问题