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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T03:05:03+00:00 2026-05-17T03:05:03+00:00

I am having a problem converting a date/time string to an NSDate. The date

  • 0

I am having a problem converting a date/time string to an NSDate.

The date string I need to convert is: 2002-12-24T00:00:00-07:00

My date format string is currently yyyy-MM-dd’T’HH:mm:ssZZZ

The problem is the colon in the time zone.

ZZZ returns a string like: -0700 (without the colon)
How can I convert a string WITH a colon in the time zone?

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-17T03:05:03+00:00Added an answer on May 17, 2026 at 3:05 am

    I suggest doing some string manipulation so it is in a form that dateWithString can more easily accept – how about using stringByReplacingOccurrencesOfString one or more times to get rid of the colon?

    dateWithString wants:

    YYYY-MM-DD HH:MM:SS ±HHMM
    

    you have:

    yyyy-MM-dd'T'HH:mm:ssZZZ
    

    You will probably need to use some combination of componentsSeparatedByString (to get rid of the ‘T’ part, unless you have a small range of values possible for T, and perhaps write yourself a small function to convert ssZZZ into +HHMM.

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

Sidebar

Related Questions

I having a problem converting a string into the date format I need. An
I am having a problem converting a datetime which is in string format but
I am having a problem with converting the date and time to milliseconds. There
I'm having a problem with converting a formatted date string into a integer timestamp.
I am having problems converting a string in the format yyyy-MM-ddZ using VB.net. For
I'm having a problem converting an inline assembler function to .asm file. I need
I am having no problem converting a string to a byteArray of UTF-16 encoded
im having a problem converting time. for some reason it seems to be defaulting
I'm having a problem converting a regular expression from Python into Flex. My string
I'm having a problem with converting LPCSTR to System::String^, though i am able to

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.