Created
September 22, 2017 07:45
-
-
Save edwardean/3a0da8392d9403ff1a8002756a3257d9 to your computer and use it in GitHub Desktop.
将NSDate转换到当前时区
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSDate *date = [NSDate date]; | |
NSTimeZone *zone = [NSTimeZone systemTimeZone]; | |
NSInteger interval = [zone secondsFromGMTForDate:date]; | |
NSDate *localDate = [date dateByAddingTimeInterval:interval]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment