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

The Archive Base Latest Questions

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

I accessing a web service after i parsing that that code i got AiringTime

  • 0

I accessing a web service after i parsing that that code i got AiringTime of US EST 2011-10-17T14:00:00Z remaining code i written below

NSString *string = [[dateArray objectAtIndex:0] objectForKey:@"AiringTime"];
NSArray *stringArray1 = [string componentsSeparatedByString:@"T"];
NSString *string1 = [stringArray1 objectAtIndex:1];
NSArray *stringArray2 = [string1 componentsSeparatedByString:@"Z"];
NSString *dateInString = [stringArray2 objectAtIndex:0];

nowDate =[stringArray1 objectAtIndex:0];

NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"hh:mm:ss"];

NSDate *dateFromString =  [formatter dateFromString:dateInString];
[formatter release];

above NSDate *dateFromString given me appropriate output like 14:00 from morning to evening 6:30PM. After evening 6:30PM dateFromString gave mi nil value even though dateInString has an appropriate value?? Why? and How it happen?

I mean,
NSDate *dateFromString = [formatter dateFromString:dateInString];
this line not working, dateFromString gave me nil output.
I wasting my last 3 days evening time due to this strange problem. Please help me.
Thanks in advance.

  • 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-26T06:30:27+00:00Added an answer on May 26, 2026 at 6:30 am

    See here, the example format is exactly the one you are dealing with.

    Instead of splitting and manipulating the string yourself, simply do the following:

    NSString *string = [[dateArray objectAtIndex:0] objectForKey:@"AiringTime"];
    //Time in according to GMT+
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyy'-'MM'-'dd'T'HH':'mm':'ss'Z'"];
    [formatter setTimeZone:[NSTimeZone timeZoneForSecondsFromGMT:0]];
    NSDate *dateFromString =  [formatter dateFromString:string];
    [formatter release];
    

    If you are only interested in the time then NSDate is meaningless. What do you want to do with it afterwards?

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

Sidebar

Related Questions

I have a asp.net website and I am accessing that web service from my
I have a Web Service written in .NET that provides data for an iPhone
I am currently accessing a web service. The only message I got from the
If I run ASP.NET, and I am accessing a foreign asmx web service that
I want to build an Axis2 client (I'm only accessing a remote web service,
I'm using Java for accessing Alfresco content server via it's web service API for
I am getting this exception while accessing the jax-ws web service from my client.
I'm having issues accessing a web service provided by a third party. Looking at
I've tried using gSOAP for accessing a web service (e.g. using supplied WSDL to
We found a problem while accessing the Web service from our ASP.Net MVC project

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.