"nsdate expressed in different time zones, i.e. local time zone (gmt-400) to pst" Code Answer

1

nsdate always returns relative to gmt

this doesn't make sense. nsdate just encapsulates an absolute moment in time (let's forget about relativity for a second) and it has no concept of time zones whatsoever. to say that nsdate times are relative to gmt is wrong.

to output a date in a specific time zone, you should create an instance of nsdateformatter and call settimezone: on it to set the time zone. according to the unicode docs, the format string @"zzz" should output the time zone value as "pst".

By Jigar Patel on August 1 2022

Answers related to “nsdate expressed in different time zones, i.e. local time zone (gmt-400) to pst”

Only authorized users can answer the Search term. Please sign in first, or register a free account.