Javascript Data Type How to - Create Date in Hawaii timezone








Question

We would like to know how to create Date in Hawaii timezone.

Answer


<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'>
window.onload=function(){<!-- w  w w. j  av  a 2s.  c o  m-->
    var HAST = 'Wed, 31 Jul 2013 07:21:16 UTC-1000';
    var hawaiiTime = new Date(HAST);
    document.writeln("Hawaii time: "+hawaiiTime);
}
</script>
</head>
<body>
</body>
</html>

The code above is rendered as follows: