NSDateFormatter not working to set setTimeZone

后端 未结 2 1687
谎友^
谎友^ 2021-01-28 15:45

I am trying to know the difference between two dates (Including days,hours,minutes and seconds). For that I am using below code, but It\'s not working.

+ (void)         


        
2条回答
  •  梦毁少年i
    2021-01-28 16:43

    Are you setting the timeZone for the output formatter and along with that are you adding the time difference to the output date?? Because, there is not need to add the time difference as setting timezone for both dateFormatters will automatically take care of the time difference between the time zones.

提交回复
热议问题