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 8507085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:46:10+00:00 2026-06-11T02:46:10+00:00

Since i just cant get a good answer for this and spend so much

  • 0

Since i just cant get a good answer for this and spend so much time on this, i will ask my question in details

All i want is to create an alarm according to date picker.
setting alarm to 10 seconds from now, is works great .
UIDatePicker, is works (print the date-but not the date i have picked, but 3 hours later)
i know there is an issue with local times, but i just cant find any good explanation.

my propose, and i guess that almost everyone,is not getting involve in local times, but to take each user’s clock, and set alarm according to his time.

my code, is not working, i dont know why. its not firing(only if i set it to 10 seconds later)

please, i know that time zone should be different or something, but if you can explain what exactly to do and how, that would be great . thanks.

this is the code :

-(void)setDatePicker
{
    CGRect pickerFrame = CGRectMake(0,265,0,0);

    UIDatePicker *myPicker = [[UIDatePicker alloc] initWithFrame:pickerFrame];
    [myPicker addTarget:self action:@selector(pickerChanged:) forControlEvents:UIControlEventValueChanged];


   [[[CCDirector sharedDirector] view] addSubview:myPicker];
     [myPicker release];
}



-(void)pickerChanged:(UIDatePicker*) datePicker
{


     date=datePicker.date;

     NSLog(@"value: %@",date);
}

and the local notification :

-(void) scheduleNotificationForDate: (NSDate*)theDate
{



/* Here we cancel all previously scheduled notifications */
[[UIApplication sharedApplication] cancelAllLocalNotifications];

UILocalNotification *localNotification = [[UILocalNotification alloc] init];


//NSDateFormatter *dateFormat = [[[NSDateFormatter alloc]init]autorelease];
//[dateFormat setDateFormat:@"YYYY-MM-dd HH:mm:ss"];
//NSDate *notificationDate = [dateFormat stringFromDate:theDate];


localNotification.fireDate = theDate;
NSLog(@"Notification will be shown on: %@",localNotification.fireDate);

localNotification.timeZone = [NSTimeZone defaultTimeZone];
localNotification.alertBody = [NSString stringWithFormat:
                               @"Your notification message"];
localNotification.alertAction = NSLocalizedString(@"View details", nil);



localNotification.soundName = UILocalNotificationDefaultSoundName;
localNotification.applicationIconBadgeNumber = -1;

[[UIApplication sharedApplication] scheduleLocalNotification:localNotification];
}
  • 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-06-11T02:46:11+00:00Added an answer on June 11, 2026 at 2:46 am

    i got it .

    i had to change the format and it worked.
    nothing that relates to zones.

    NSDateFormatter *dateFormat = [[[NSDateFormatter alloc]init]autorelease];
         [dateFormat setDateFormat:@"YYYY-MM-dd HH:mm:ss"];
        NSString *dateString = [dateFormat stringFromDate:date];
        NSDate *notificationDate = [dateFormat dateFromString:dateString];
    
    
        localNotification.fireDate = notificationDate;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just read on this answer (answer has since been removed) and I'm sure
This just saves time. Since I already have a web applciation. I can just
This may be a stupid question but I just can't find the answer. What
Since the last time I asked a question I've gotten some really good answers,
This is just a question out of curiosity since I have been needing to
I have been browsing tutorials but all are just gibberish since I do not
I just have this issue with reading from a network stream in C#. Since
Before I ask my question can I please ask not to get a lecture
I'm using Test::Unit with shoulda to test a controller. Since I'm just testing the
I have just started reading about ORMLite since I am interested in using it

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.