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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:17:11+00:00 2026-05-13T19:17:11+00:00

I have an NSDate and a duration. I need to get the time after

  • 0

I have an NSDate and a duration. I need to get the time after the duration

Given:
The date is “2010-02-24 12:30:00 -1000”
duration is 3600 secs

I need to get “2010-02-24 13:30:00 -1000”

I thought dateWithTimeIntervalSinceReferenceDate:, would do the trick but I see now that this gives a date offset from 1 Jan 2001 GMT.

Is there another C function I need to use

  • 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-13T19:17:12+00:00Added an answer on May 13, 2026 at 7:17 pm

    As DyingCactus states, you can use the addTimeInterval method of NSDate, but depending on the OS version is will create a compiler warning, since it is deprecated in 10.6 as of 2009-08-17.

    The current recommended method is to use dateByAddingTimeInterval on NSDate:

    NSDate *newDate = [oldDate dateByAddingTimeInterval:3600];
    

    Note that if you are targeting 10.5 or earlier, the original answer will work.

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

Sidebar

Related Questions

I have a UIDatePicker and I get the date using this: NSDate *pickerDate =
I have an NSDate that I get from a UIDatepicker. IBOutlet UIDatePicker *dueDate; NSDate
I have an NSDate object and need an integer of the day. i.e. if
Say I have the following: NSDate *today = [NSDate date]; How do I just
i have this code in my overridden drawRect method NSDate *date = [NSDate date];
For example I have NSDate *curDate = [NSDate date]; and its value is 9:13
I have two instances of NSDate (a start time and an end time) and
I have this code NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@yyyy-mm-dd'T'HH:mm:ss.SSSSS]; NSDate *date
i have an NSDate object from an old date which i am getting from
I have a NSDate object. Let's say it represents 1-10-2011 NSDate *date = [df

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.