Skip to main content
deleted 25 characters in body
Source Link
John Koerner
  • 37.9k
  • 8
  • 88
  • 137

I wrote asome code in Javascript that was working without any problem. But when I put the date October 20, 2013October 20, 2013, I was returned tothe date October 19, 2013October 19, 2013.

The

The same applies to the years 20192019, 20242024 and 20302030 (not tested previous previous years and not later).

This problem shows up in all browsers I test (Google Chrome, Internet Explorer, Mozilla Firefox, Opera and Safari).

When I write:

date = new Date("10/20/2013");
document.write(date);

The result I get is:

Sat Oct 19 2013 23:00:00 GMT-0300 (BRT)


Someone could tell me why this is happening and how can I solve this problem?

I wrote a code in Javascript that was working without any problem. But when I put the date October 20, 2013, I was returned to date October 19, 2013.

The same applies to the years 2019, 2024 and 2030 (not tested previous years and not later).

This problem shows up in all browsers I test (Google Chrome, Internet Explorer, Mozilla Firefox, Opera and Safari).

When I write:

date = new Date("10/20/2013");
document.write(date);

The result I get is:

Sat Oct 19 2013 23:00:00 GMT-0300 (BRT)


Someone could tell me why this is happening and how can I solve this problem?

I wrote some code in Javascript that was working without any problem. But when I put the date October 20, 2013, I was returned the date October 19, 2013.

The same applies to the years 2019, 2024 and 2030 (not tested previous years and not later).

This problem shows up in all browsers I test (Google Chrome, Internet Explorer, Mozilla Firefox, Opera and Safari).

When I write:

date = new Date("10/20/2013");
document.write(date);

The result I get is:

Sat Oct 19 2013 23:00:00 GMT-0300 (BRT)


Someone could tell me why this is happening and how can I solve this problem?
Source Link
Júlio Pradera
  • 472
  • 2
  • 9
  • 25

Problems with the date 20 October in some years

I wrote a code in Javascript that was working without any problem. But when I put the date October 20, 2013, I was returned to date October 19, 2013.

The same applies to the years 2019, 2024 and 2030 (not tested previous years and not later).

This problem shows up in all browsers I test (Google Chrome, Internet Explorer, Mozilla Firefox, Opera and Safari).

When I write:

date = new Date("10/20/2013");
document.write(date);

The result I get is:

Sat Oct 19 2013 23:00:00 GMT-0300 (BRT)


Someone could tell me why this is happening and how can I solve this problem?