Hi I have a code like this.
var date = new Date(), y = date.getFullYear(), m = date.getMonth();
var firstDay = new Date(y, m, 1);
The result is like this:
"Thu Sep 01 2016 00:00:00 GMT+0800 (China Standard Time)"
How do I remove the time and other texts so that I'll have a result like this:
"Thu Sep 01"
I already tried .split(' ')[0]
and .replace
but it says that it is not a function.
Thanks!