Actually I tried setting a jquery datepicker with a specific date, but when I create a new date to set the widget, javascript throws me one day minus
the code:
new Date('2016-04-14')
Result:
Wed Apr 13 2016 17:00:00 GMT-0700 (US Mountain Standard Time)
jsfiddle
You must read the exact manual.
Note: parsing date strings with a constructor Date(and Date.parsethey are equivalent) is very discouraged due to browser differences and inconsistencies.
Date
Date.parse
, new Date(2016, 3, 14) (3, ). , 14 .
new Date(2016, 3, 14)
UTC (GMT), .toUTCString() .toString().
.toUTCString()
.toString()
, iso8601, 2016-04-01T00:00:00-07:00. .
2016-04-01T00:00:00-07:00