Develop
2015.04.07 16:27
[ios] GMT Date와 Local Date 변환하기
조회 수 833 댓글 0
# Local Date -> GMT Date
NSDate *localDate = <<your local date>>; NSTimeInterval timeZoneOffset = [[NSTimeZone systemTimeZone] secondsFromGMTForDate:localDate]; // NOTE the "-" sign! NSDate *gmtDate = [localDate dateByAddingTimeInterval:-timeZoneOffset];
# GMT Date -> Local Date
NSDate *gmtDate = <<your gmt date>> NSTimeInterval timeZoneOffset = [[NSTimeZone systemTimeZone] secondsFromGMTForDate:gmtDate]; NSDate *localDate = [gmtDate dateByAddingTimeInterval:timeZoneOffset];
[출처] http://stackoverflow.com/questions/1862905/nsdate-convert-date-to-gmt
-
[io] Apple Watch, Today Extension 앱ID 설정
-
[ios] Did UIScrollView End Scrolling?
-
[ios] How To Use UIScrollView to Scroll and Zoom Content (Using Swift)
-
[ios] How To Use UIScrollView to Scroll and Zoom Content (Using Objective-C)
-
[js] AngularJS 란?
-
[php] 한글 문자열 자르기 (utf-8)
-
[c] 한글 문자열 출력
-
[ios] NavigationController 에서 왼쪽(back) 버튼 후킹하기
-
[ios] ViewController Push할 때 애니메이션 효과
-
[linux] CentOS Apache 웹서버에 HTTPS 적용
-
[c] 기막힌 정렬 코드 ㅋㄷ
-
[ios] 상위 ViewController 가져오기