I want to set different timezone in Javascript.Currently It is showing date and time zone of local machine or client's PC date /timezone.
Regards,
Javascript is a client-side language and does not interact with the server that way. You'll need to fetch that data from your server-side platform.
Here is some PHP code to get the data you are looking for. You'll either need to put this in your page and echo the result into a JS variable....
<?php
$date = new DateTime(null, new DateTimeZone('Europe/London'));
$tz = $date->getTimezone();
$tzone = $tz->getName();
?>
<script type="text/javascript">
var timeZone='<?php echo $tzone ?>';
</script>
....or keep the PHP page separate, and fetch the data using AJAX
getTimeZone.php
<?php
$date = new DateTime(null, new DateTimeZone('Europe/London'));
$tz = $date->getTimezone();
echo $tz->getName();
?>
JS
var timeZone=null;
$.get('getTimeZone.php', function(result){
timeZone=result;
}, 'html');
//I know this is jQuery, not JS, but you get the idea.
Michael Koper. I was wondering the same thing myself.