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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T13:19:35+00:00 2026-06-17T13:19:35+00:00

I have a string 2013-01-10T08:24:12.503 which is ‘date’ and ‘time’.This is the format that

  • 0

I have a string 2013-01-10T08:24:12.503 which is ‘date’ and ‘time’.This is the format that I receive from my server.

I want to display this in the format 2013-01-10 08:24:12.
How can I do this?

Please help me out.

  • 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-17T13:19:36+00:00Added an answer on June 17, 2026 at 1:19 pm

    You need to esacpe the T string

    NSString *string = [NSString stringWithFormat:@"2013-01-10T08:24:12.503"];
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateFormat:@"yyyy-MM-dd'T'HH:mm:ss.SSS"];
    

    Using above format get normal NSDate

    NSDate *formattedDate = [dateFormatter dateFromString:string];   // 2013-01-10 02:54:12 +0000
    

    Again set the format you want

    [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
    

    Get the String you want,

    NSString *curDate = [dateFormatter stringFromDate:date];    // 2013-01-10 08:24:12
    

    Check this link, where i got reference.

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

Sidebar

Related Questions

I have string that look like Array that fetched from other webservice like this
I have a date-string like this: 2013-01-04T15:55:51.217+01:00 I can get a date like this:
I have a string like this: http://x.com/xyz/2013/01/16/zz/040800.php I want to get two strings from
I have a Date with string format (For example 01/01/2013). How to I get
I have String variable which contains date. Now how to display July 15 from
I am getting a date from JSON file, and it is in string format.I
I have an ArrayList(String) which contains a list of formatted dates like this: element
I have a given string array of date, the format is dd/mm/yyyy . I
I have a data table that has the following columns: id (string), date (date),
I have time stamp as string 2013-01-28 11:01:56.9. Here 56.9 seconds are mentioned. .9

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.