I am planning a local notification with NSDate with the time set at 9 pm and setting the time zone for notifications in UTC / GMT format.
If I set the device’s time zone to UTC (and the time is up to 8.59pm), then the notification is triggered at 9pm, as expected.
However, if I set the device’s time zone to the US West Coast (i.e., installed it directly in Seattle or Cupertino or PDT, etc.) and set the time to 1.59 pm or set the device’s time zone for the US East Coast and set the time for 4.59pm, then the notification does not work at 2 hours or 5 pm, respectively.
But I expected that this should happen, because when it is 9 pm UTC, then with the current summer day at this time of the year, 9 pm UTC is equivalent to 5 pm Eastern and 2 hours Western time.
If I set the time on the device to 8.59pm while the device’s time zone is PDT, the notification will be triggered at 9pm, even if I set the time zone in the notification for UTC / GMT, this is not true because 21:00 PDT is not 9pm UTC.
Therefore, it seems to me that the OS ignores the notification time zone that I set. Does anyone have any explanation why it is not working properly?
thank
source
share