When I'm creating a new Date object and pass in a date using hyphens
new Date("2015-07-02") // I get Thu Jul 02 2015 01:00:00 GMT+0100 (IST)
and when I use forward slashes
new Date("2015/07/02") // I get Thu Jul 02 2015 00:00:00 GMT+0100 (IST)
notice the time difference: 01:00:00 for hyphens and 00:00:00 for forward slashes
this breaks my code :(
Why this is happening? Any workaround for this? (Should I just set time to 00:00:00 when using hyphens?)
I need to be able to compare dates that have forward-slashes with dates that have hyphens and I'm not sure I might need to compare dates with some other symbols.
Is this happening to hyphens only?
Thanks.