iOsѧϰ֮ NSDate 8СʱÎó²î -µçÄÔ×ÊÁÏ

µçÄÔ×ÊÁÏ Ê±¼ä£º2019-01-01 ÎÒҪͶ¸å
¡¾www.unjs.com - µçÄÔ×ÊÁÏ¡¿

    1.

   

- (NSDate*)localeDate:(NSDate*)date {    NSTimeZone *zone = [NSTimeZone systemTimeZone];    NSInteger interval = [zone secondsFromGMTForDate: date];    NSDate *localeDate = [date dateByAddingTimeInterval: interval];    return localeDate;£ý

    2.

   

[dateFormat setTimeZone:[NSTimeZone timeZoneWithAbbreviation:@"UTC"]];

×îÐÂÎÄÕÂ