mounish mounish - 4 months ago 42
jQuery Question

timezone convertion issue when system preferences and user preferences are different in javascript

date is not coming properly when my system preference Asia/Kolkata,user preferences input date is America/Los_Angeles both are different

date is coming properly when my system preference & user preferences same

jsfiddle example :

//system preference Asia/Kolkata
// input date America/Los_Angeles --- 2016-11-09 02:00:00
var date = new Date("2016-11-09 02:00:00");
var gmtdate = date.toGMTString(); -- converting into GMT

any one help me out from this issue.

Thanks in Advance,


Try this:

// Parse the date in Los Angeles timezone.
const date ='2016-11-09 02:00:00', 'America/Los_Angeles');
// Output the date.
// Output the date in Asia/Kolkata timezone.
<script src=""></script>
<script src=""></script>