Parse date without timezone javascript

I want to parse a date without a timezone in JavaScript. I tried:

new Date(Date.parse("2005-07-08T00:00:00+0000"));

Which returned 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 the same result and:

new Date(Date.parse("2005-07-08 00:00:00 GMT-0000"));

also returns the same result.

I want to parse time:

  1. without time zone.
  2. without calling a constructor Date.UTC or new Date(year, month, day).
  3. by simply passing a string into the Date constructor (without prototype approaches).

I have to produce a Date object, not a String.

14 Answers
14

Leave a Comment