Remove time from GMT time format

Grady D picture Grady D · Jan 9, 2015 · Viewed 70.1k times · Source

I am getting a date that comes in GMT format, Fri, 18 Oct 2013 11:38:23 GMT. The problem is that the time is messing up the timeline that I am using.

How can I strip out everything except for the actual date?

Answer

Gio Asencio picture Gio Asencio · Jun 8, 2016

If you want to keep using Date and not String you could do this:

var d=new Date(); //your date object
console.log(new Date(d.setHours(0,0,0,0)));

-PS, you don't need a new Date object, it's just an example in case you want to log it to the console.

http://www.w3schools.com/jsref/jsref_sethours.asp