In this tutorial, we will tell you how to get the country wise date and time. you can use the below code to get country wise timezone or date.

here, we will use getTime and getTimezoneOffset function in this below example. it's the function to convert date and timezone.

see below example, I think can help you.

<script>
function calcTime(city, offset) {

d = new Date();

utc = d.getTime() + (d.getTimezoneOffset() * 60000);

convert = new Date(utc + (3600000*offset));

return "The local time in " + city + " is " + convert.toLocaleString();

}

// get Bombay time
console.log(calcTime('Bombay', '+5.5'));

// get Singapore time
console.log(calcTime('Singapore', '+8'));

// get London time
console.log(calcTime('London', '+1'));
</script>