0

I applied jquery ui datepicker in my project.It is working fine with india location. but when i checked with US location my date displays one lesser than I selected in datepicker. sample code is below:

var date = $(this).val();
selectedMonth = $.datepicker.formatDate('M',new Date(date));
selectedYear = $.datepicker.formatDate('yy',new Date(date));                    
selectedDate = $.datepicker.formatDate('dd',new Date(date));            

alert( selectedDate +"/ "+selectedMonth+"/"+selectedYear);
Anup
  • 3,283
  • 1
  • 28
  • 37
  • http://stackoverflow.com/questions/22717201/how-to-avoid-time-zone-issues-with-jquery-datepicker – naortor Sep 07 '16 at 05:53
  • not solving with this – Anup Sep 07 '16 at 06:12
  • Which Time Zone do you want to be default? The browser is going to assume the time zone of the computer that it is running on. Also are the Date/Time settings of that local computer configured correctly? – Twisty Sep 16 '16 at 17:41
  • See also: http://stackoverflow.com/questions/439630/how-do-you-create-a-javascript-date-object-with-a-set-timezone-without-using-a-s – Twisty Sep 16 '16 at 17:42

0 Answers0