Actually I tried to set a jquery datepicker with a determinated date but when I create a new date for set the widget, javascript throw me one day minus
Code:
new Date('2016-04-14')
Result:
Wed Apr 13 2016 17:00:00 GMT-0700 (US Mountain Standard Time)
You should read the fine manual
Note: parsing of date strings with the
Date
constructor (andDate.parse
, they are equivalent) is strongly discouraged due to browser differences and inconsistencies.
You should probably go with new Date(2016, 3, 14)
(3 because the month integer is zero-based). This will create a date in your timezone at midnight, April 14.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments