Datepicker uses UTC (+800) time by default. You will need the moment-timezone api to change your timezone.
You can then convert the timezone to whatever timezone you want:
// guess current client’s timezone
var guess = moment.tz.guess();
// get moment object from datetimepicker
var datetime = $(‘#datetimepicker’).data(“DateTimePicker”).date();
// convert moment object’s timezone
datetime.tz(guess);
// set moment object as new value for datetimepicker
$(‘#datetimepicker’).data(“DateTimePicker”).date(datetime);
// also tell datetimepicker about the used timezone
$(‘#datetimepicker’).data(“DateTimePicker”).timeZone(guess);
-
This reply was modified 8 years, 3 months ago by
Prafull.
-
This reply was modified 8 years, 3 months ago by
Prafull.