Skip to content

Instantly share code, notes, and snippets.

@ethanbing
Created August 23, 2014 08:05
Show Gist options
  • Save ethanbing/28848417e3121036af8d to your computer and use it in GitHub Desktop.
Save ethanbing/28848417e3121036af8d to your computer and use it in GitHub Desktop.
调整8小时差
NSDate *date = [NSDate date];
// 调整8小时时差
NSTimeZone *zone = [NSTimeZone systemTimeZone];
NSInteger interval = [zone secondsFromGMTForDate:date];
NSDate *localeDate = [date dateByAddingTimeInterval: interval];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment