2

I am using jquery-ui-timpicker-addon.js. I have to set timezone in GMT instead of local time. In below code I am able to change the time in GMT but the date is not updating accordingly. Please let me know

$.datepicker._gotoToday = function (id) {
var inst = this._getInst($(id)[0]), $dp = inst.dpDiv;
this._base_gotoToday(id);
var tp_inst = this._get(inst, 'timepicker');
var now = new Date();
var now_utc = new Date(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate(), now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds());
this._setTime(inst, now_utc);
$('.ui-datepicker-today', $dp).click();
Matt Johnson-Pint
  • 230,703
  • 74
  • 448
  • 575
user2521071
  • 21
  • 1
  • 4
  • This only shows how you are building `now_utc`. The rest of the code is not part of jQueryUI's date picker, but rather from elsewhere in your own project. Please show just the parts required to actually reproduce the problem. Keep in mind that we do not have access to your source code. Thanks. – Matt Johnson-Pint Oct 15 '13 at 14:48

1 Answers1

2
//this._setTime(inst, now_utc);
//$('.ui-datepicker-today', $dp).click();
$(id).datepicker('setDate', new Date(now_utc.getTime()));