Still a problem for many ... although you can change the source code to always use UTC time, this is not a solution in many cases, since you may need both UTC functionality and standard (local time) functionality on the same page. . therefore .. My solution is to hide the button now in UTC timepicker types.
Note ! it is not perfect, I know, since the timeout is triggered after the βnowβ button is displayed, this may give a short βblinkingβ .. but this is normal for me. It hides the "now" button in the collectors I need, and I don't need to change the datetimepicker script!
// hides the "now" button (as fast as possible) for the // datetimepickerUTC, as that button only works with local time! var datetimepickerUTCNowHider = function( currentDateTime ){ setTimeout(function () { $('.datetimepickerUTC').datepicker("widget").find(".ui-datepicker-current").hide(); }, 0.001 ); }; //the utc time var dateNow = new Date(); var utc = new Date(dateNow.getTime() + dateNow.getTimezoneOffset() * 60000); // the datetimepicker $('.datetimepickerUTC').datetimepicker({ dateFormat: 'yymmdd', timeFormat: 'HH:mm', controlType: 'select', hour: utc.getHours(), minute: utc.getMinutes(), beforeShow: datetimepickerUTCNowHider, onSelect: datetimepickerUTCNowHider, showWeek: true });
source share