Rick
Rick

Reputation: 65

scheduledLocalNotifications showing wrong timezone

i can get list of my scheduledLocalNotifications in my table view with this code perfectly ;

NSArray *notificationArray = [[UIApplication sharedApplication] scheduledLocalNotifications];

but the only problem is , my local notifications are firing on correct time but showing with wrong time zone on the list.

I'm also using systemTimeZone for scheduling my local notification like this ;

notification.timeZone = [NSTimeZone systemTimeZone];

What is the correct way to get a list of scheduledLocalNotifications with the correct time zone?

Thanks in advance

Upvotes: 0

Views: 146

Answers (1)

Hakim
Hakim

Reputation: 1314

I've had the same problem when after i had already scheduled a notification at 3:30 pm and it was correctly scheduled when i NSLog it's fireDate it'll show up in a different time zone and that's how i fixed it.

[localNotification.fireDate descriptionWithLocale:NSGregorianCalendar]

this will return fire date with the Gregorian local (or you should use whatever local you have used when scheduling your local notification)

Upvotes: 1

Related Questions