Search code examples
iphonensdateutcgmtnstimeinterval

NSTimeInterval in UTC?


I am calculating current time Interval using following codes:

NSTimeInterval tInt=[[NSDate date] timeIntervalSince1970];
int tInterval=(int)tInt;

Is this timestamp is in utc time ?

I need NSTimeInterval in UTC Time.

Please help


Solution

  • NSTimeInterval is an interval of time, like 5 seconds, 2 hours, 3 days and so on it is not "in timezone" time, it is relative time between two time points.

    I'm not sure what exactly you looking for but have a look at Apple's doc for using timezones.