2

我正在使用 jquery-ui-timpicker-addon.js。我必须在 GMT 而不是当地时间设置时区。在下面的代码中,我可以更改 GMT 时间,但日期没有相应更新。请告诉我

$.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();
4

1 回答 1

2
//this._setTime(inst, now_utc);
//$('.ui-datepicker-today', $dp).click();
$(id).datepicker('setDate', new Date(now_utc.getTime()));
于 2013-11-08T15:32:58.937 回答