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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:34:43+00:00 2026-05-28T16:34:43+00:00

I am querying facebook graph api. It returns date in following format: 2012-01-23T23:52:29+0000 .

  • 0

I am querying facebook graph api. It returns date in following format: 2012-01-23T23:52:29+0000.

I need to find difference of dates of this type in javascript. It’s not a valid date in javascript ( by Date.parse() or new Date() )

I am thinking of replacing 'T' with ' ' (a space), '-' with '/' and '+0000' with '' (empty string). Is this the only way? Or am I missing something here?

Also, if this is the only way, can someone give me a regex to replace all in one go?

Execution speed is my main concern.

  • 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-28T16:34:43+00:00Added an answer on May 28, 2026 at 4:34 pm

    I’d say yes to replacing - with /, since that’s that the ISO-whatever standard dictates (Facebook likes to screw things around, like <meta> tags with property attributes instead of name like they should be).

    Keep the timezone part, since JS understands that and will handle it accordingly.

    Overall, you want new Date(input.replace(/-/g,'/'));.

    In response to comments, a better (more complete) solution would be:

    new Date(input.replace(/-/g,'/').replace("T"," ").replace(/\+[0-9]+$/,''));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When querying facebook graph's api I see that there are several properties missing, for
I am trying to get user album by using GRAPH API with function facebook.request(contact.getFacebook_id()+/albums)
When querying the Graph API with a 'known' browser the JSON output is formatted
I am querying data from views that are subject to change. I need to
I'm querying the facebook feeds to get the latest feeds. I'm using the FB
Requirement : Get like count of all pages under my FB account. FQL https://api.facebook.com/method/fql.query?query=SELECT+user_id,object_id,post_id+FROM+like+WHERE+user_id=me()
When querying a collection using linq it always returns a null Collection<JCTransLabour> oJCTransLabours =
Possible Duplicate: Querying Users who 'like' my Facebook Page Currently all the solutions on
When querying SolR with a date SolR will actually highlight stuff from the text
In querying an API that has a paginated list of unknown length I found

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.