Reputation: 943
I am using Jquery datetime picker. $('.datepicker').datetimepicker();
I need to set timezone. Like America/New_york Is there any way to give in options ? Currently it is taking my system timezone.
Upvotes: 0
Views: 976
Reputation: 466
http://momentjs.com/ is great library for timezone conversions.
var newYork = moment.tz("2016-06-01 12:00", "America/New_York");
var losAngeles = newYork.clone().tz("America/Los_Angeles");
var london = newYork.clone().tz("Europe/London");
newYork.format(); // 2016-06-01T12:00:00-04:00
losAngeles.format(); // 2016-06-01T09:00:00-07:00
london.format(); // 2016-06-01T17:00:00+01:00
and
By default, moment parses and displays in local time.
Hope help you.
Upvotes: 2