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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T12:53:49+00:00 2026-05-24T12:53:49+00:00

Hello friends, I have a string like /Date(1312628727617+0000)/ and this regular expression convert into

  • 0

Hello friends,

I have a string like “/Date(1312628727617+0000)/” and this regular expression convert into Date format in iPhone so please provide any link or any idea to develop this functionality.

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-24T12:53:50+00:00Added an answer on May 24, 2026 at 12:53 pm

    Use the below method and pass your regular expression date /Date(1312628727617+0000)/ as parameter.

    - (NSDate*) getDateFromJSON:(NSString *)dateString
    {
        // Expect date in this format "/Date(1268123281843)/"
        int startPos = [dateString rangeOfString:@"("].location+1;
        int endPos = [dateString rangeOfString:@")"].location;
        NSRange range = NSMakeRange(startPos,endPos-startPos);
        unsigned long long milliseconds = [[dateString substringWithRange:range] longLongValue];
        NSLog(@"%llu",milliseconds);
        NSTimeInterval interval = milliseconds/1000;
        return [NSDate dateWithTimeIntervalSince1970:interval];
    }
    

    EDIT:

      NSDateFormatter *dateForm = [[NSDateFormatter alloc] init];
      [dateForm setDateFormat:@"yyyy-MM-dd hh:mm:ss"];
      NSString *dateStr = [dateForm stringFromDate:<YourNSDateObject>];
      [dateForm setDateFormat:@"<Your Desired Date Format>"];
      NSDate *desireddate = [dateForm dateFromString:dateStr];
    

    Hope this helps you.

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

Sidebar

Related Questions

Hello friends a newbie question... The Issue is like this: I have a static
VS2005, ASP.NET, C#, IIS6 Hello friends, I have a master page divided into three
hello friends I am newbie to Yii.I have the date and time in mysql
Hello my smart friends i have this contact form that i am working on.
Hello I was writing a Regular Expression (first time in my life I might
Hello friends i have a form view i have handele all needed events successfully
hello friends i have a check box list which contains all the courses kept
Hello friends I have three div tags on my page.. I am trying to
Hello Friends I am using a list box control in aspx page i have
Hello Functional C# Friends, So this time i am trying to compact my code

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.