Results 1 to 3 of 3

Thread: how to purse json date

  1. #1
    Ext User
    Join Date
    Sep 2010
    Posts
    73
    Vote Rating
    0
      0  

    Default how to purse json date

    Hi,

    I am wondering how to parse a json date time format {"Date":"\/Date(1287602408923)\/"} returned from a web service?

    Thanks

  2. #2
    Ext User merry andrew's Avatar
    Join Date
    Jul 2010
    Location
    Ellensburg
    Posts
    25
    Vote Rating
    0
      0  

    Default

    Here's what I used to parse a string like "\/Date(1287602408923)\/" (passed as oDateStr):

    Code:
    var modDate = function(oDateStr) {
    	var dateStr = oDateStr.slice(6, 19);
    	var dateInt = parseInt(dateStr);
    	dateInt += 86400000; // milliseconds in a day... added to aid accuracy of MS AJAX serialized date
    	return (new Date(dateInt).format('F j, Y')); 
    };

  3. #3
    Ext User
    Join Date
    Sep 2010
    Posts
    73
    Vote Rating
    0
      0  

    Default

    thanks a lot for your help!

Similar Threads

  1. Date Format from JSON
    By ExtJSBeginner in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 8 Mar 2010, 11:35 PM
  2. JSON vs Gris vs Date
    By 666ragez666 in forum Ext GWT: Help & Discussion (1.x)
    Replies: 3
    Last Post: 22 Jan 2009, 9:52 PM
  3. java Json Date
    By quartex in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 22 Jan 2008, 9:35 AM
  4. Using Date in JSON
    By Ramsay in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 11 Jan 2008, 3:35 AM
  5. json and date - how to map?
    By luc98 in forum Ext 1.x: Help & Discussion
    Replies: 5
    Last Post: 24 May 2007, 9:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •