Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5964849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:30:27+00:00 2026-05-22T19:30:27+00:00

I have searched for help on this issue but I am falling short of

  • 0

I have searched for help on this issue but I am falling short of an answer. I am setting an event reminder with code. Using break points and stepping thru. I see the event time is correct. Below is how I set my reminder

EKEventStore *eventDB = [[[EKEventStore alloc] init]autorelease];
EKEvent *myEvent  = [EKEvent eventWithEventStore:eventDB];
NSString * eventTitle = [NSString stringWithFormat:@"%@ - %@",app.dealerBusinessName,serviceOrComments.text];
myEvent.title = eventTitle;




// "destinationDate" is the date I want to set the reminder for it is correct in debugger
//its format is 2011-06-03 15:45:58 +0000 which means (i would think) that the reminder
//should be set for 6/3/2011 3:45PM but its always 6 hours earlier (in this case at 9:45am

NSLog(@"value: %@",destinationDate);

    myEvent.startDate = [[[NSDate alloc] initWithTimeInterval:0 sinceDate:destinationDate ]autorelease];
myEvent.endDate   = [[[NSDate alloc] initWithTimeInterval:3600 sinceDate:myEvent.startDate]autorelease];
    myEvent.allDay = NO;

    myAlarmsArray = [[NSMutableArray alloc] init];
    EKAlarm *alarm1 = [EKAlarm alarmWithRelativeOffset:-3600]; // 1 Hour
    EKAlarm *alarm2 = [EKAlarm alarmWithRelativeOffset:-86400]; // 1 Day
    [myAlarmsArray addObject:alarm1];
    [myAlarmsArray addObject:alarm2];
    myEvent.alarms = myAlarmsArray;



[myEvent setCalendar:[eventDB defaultCalendarForNewEvents]];

NSError *err;

[eventDB saveEvent:myEvent span:EKSpanThisEvent error:&err]; 

    if (err == noErr) {
        //no error, but do not show alert because we do that below.
    }

Now im pretty sure I can just add 21,600 to the time but is that the correct way to do it? I am not understanding how NSDate works and its driving me nuts. Can someone explain to me what the correct way to do this is? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T19:30:28+00:00Added an answer on May 22, 2026 at 7:30 pm

    I had a similar problem lately, it was really driving me nuts. You have to take your time zone into account (or the timezone your simulator/device are set to). NSDate represents always GMT time, NSCalendar the time within the time zone. So the time differences you are experiencing will exactly be the time difference between your time zone and GMT (your alarm gets triggered at 15:45 GMT).

    Since I want my dates to be absolute, regardless of the time zone, I am setting all my NSCalendars to GMT – it works in my case, of course YMMV.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have searched alot of this issue on google but unable to get any
I have searched the internet and the perforce help pages, but couldn't find a
I am using c# .net. Thanks in advance for any help. I have searched
I have a little problem. i searched but did not get help to solve
I have searched for a general solution to this but only find answers to
I have searched and searched for this but I think my terminology isn't correct
I've searched on this issue, and found many flavors and ideas but no real
I searched internet and SO but could not get solution to this issue. I
I have searched for and found various q/a on this error, but have not
I am using below code to add strings to NSMutableArray . But the issue

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.