one guy suggest this to me
If you know the UTC offset then you can pass it and get the time using following function:
function calcTime(city, offset) {
// create Date object for current location
var d = new Date();
// convert to msec
// subtract local time zone offset
// get UTC time in msec
var utc = d.getTime() - (d.getTimezoneOffset() * 60000);
// create new Date object for different city
// using supplied offset
var nd = new Date(utc + (3600000*offset));
// return time as a string
return "The local time for city"+ city +" is "+ nd.toLocaleString();
}
alert(calcTime('Bombay', '+5.5'));
but i know the user pc timezone like "Asia/Kolkata" or "Europe/London" then how could i fetch date and time using any js library. moment.js can do that if yes so please give me some moment.js related code where i will pass time zone id and get that timezone date & time. thanks