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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T07:35:39+00:00 2026-06-02T07:35:39+00:00

I am receiving date in json response and parsing it using date-format javascript library.

  • 0

I am receiving date in json response and parsing it using date-format javascript library. It’s working fine in Firefox but throws exception in IE.

date received from json
response.actionDateTime : 2012-04-12T18:23:49

here is what I tried

dateFormat(response.actionDateTime,"dd-mmm-yyyy HH:MM:ss")

It throws exception on following lines of date format library

date = date ? new Date(date) : new Date;
if (isNaN(date)) throw SyntaxError("invalid date");

I am unable to resolve it yet.

  • 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-02T07:35:40+00:00Added an answer on June 2, 2026 at 7:35 am

    And finally, I came up with following cross browser solution. just parsed string to date.

    /*
        returns date object from string in dd-mm-yyyy HH:MM:SS format
    */
    function parseDate(string) {
        var dateTimeArr = string.split(" ");
    
        var date = dateTimeArr[0].split("-");
        var time = dateTimeArr[1].split(":");
    
        var day = parseFloat(date[0]);
        var month = parseFloat(date[1]) - 1;    //months : 0-11
        var year = parseFloat(date[2]);
    
        var hour = parseFloat(time[0]);
        var minute = parseFloat(time[1]);
        var second = parseFloat(time[2]);
    
        var dateObj = new Date(year, month, day, hour, minute, second);
    
        return dateObj;
    

    }

    But I am still missing date format library.

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

Sidebar

Related Questions

I'm receiving an exception when parsing the following date: SimpleDateFormat sdf = new SimpleDateFormat(EEE
I'm receiving an ajax response that has a date in the format mm/dd/yy. How
I'm receiving a JSON date in the following format : launch_date: 1250553600 How should
I'm trying to format JSON response date value: NSDateFormatter *df = [[NSDateFormatter alloc] init];
I'm receiving some date format, an ISO-something, and was wondering what the appropriate way
I am receiving JSON in the following format that I parse and store in
I'm receiving a date field from a php file, and I need to format
While trying to transform the date format I get an exception:unparseable date and don't
I am using jquery-tmpl and receiving the following JSON data, which I am using
I'm receiving a date from a data source which is returned to javascript 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.