NSDateComponents components:fromDate and Time Zones

后端 未结 3 2080
抹茶落季
抹茶落季 2020-12-28 21:14

I have a method which extracts the hour and second components form a NSDate by breaking it down into its NSDateComponents. My code is as follows...

unsigned         


        
3条回答
  •  北荒
    北荒 (楼主)
    2020-12-28 21:30

    The thing is, GMT is not equal to British Summer Time. The date 2010-08-02 08:00:00 +0100 is equal to 2010-08-02 07:00:00 GMT so 7 hours is the result you should expect.

提交回复
热议问题