Get date time for a specific time zone using JavaScript

var offset = -8;
new Date( new Date().getTime() + offset * 3600 * 1000).toUTCString().replace( / GMT$/, "" )

"Wed, 20 Jun 2012 08:55:20"

<script>
  var offset = -8;

  document.write(
    new Date(
      new Date().getTime() + offset * 3600 * 1000
    ).toUTCString().replace( / GMT$/, "" )
  );
</script>

Leave a Comment

techhipbettruvabetnorabahisbahis forumu