jquery - my date is Tue, 02 Jun 2015 02:56:20 GMT i need to convert it to month day, year -


my date returning value tue, 02 jun 2015 02:56:20 gmt. need show june 2, 2015 14:56. how can this?

var ipokerdatemod = ipokerajax.getresponseheader("last-modified"); console.log(ipokerdatemod ); 

thanks

you can convert date string unix time (milliseconds since 1970-01-01t00:00:00z) , javascript date object display it. looks date want using +1200 utc offset depending on how storing data, can decide how convert.

to convert date string unix time, use date.parse() (link on mdn) such following:

var milliseconds = date.parse('tue, 02 jun 2015 02:56:20 gmt'); var mydate = new date(); mydate.settime(milliseconds); 

Comments