I want to parse date without timezone in JavaScript. I have tried:
new Date(Date.parse("2005-07-08T00:00:00+0000"));
Returns Fri Jul 08 2005 02:00:00 GMT+0200 (Central European Daylight Time)
new Date(Date.parse("2005-07-08 00:00:00 GMT+0000"));
Returns same result
new Date(Date.parse("2005-07-08 00:00:00 GMT-0000"));
Returns same result
I want to parse time:
Without time zone.
Without calling constructor Date.UTC or new Date(year, month, day).
Just simple passing string into Date constructor (without prototype approaches).
I have to product
Date
object, notString
.
Date.parse
btw and directly pass the string to theDate
constructor. – BergiDate
object to obtain correct object to compare dates in MongoDB:new Date(dateStart.getFullYear(), dateStart.getMonth(), dateStart.getDate())
– Athlan