Click to See Complete Forum and Search --> : How to output the current time with the difference of 5 hours in javascript?


shasidi
10-05-2003, 11:20 AM
I want to make the current time and time with 5 hours difference. How can I make it?

Charles
10-05-2003, 12:17 PM
<script type="text/javascript">
<!--
Date.ONE_SECOND = 1000;
Date.ONE_MINUTE = Date.ONE_SECOND * 60;
Date.ONE_HOUR = Date.ONE_MINUTE * 60;

alert (new Date(new Date().getTime() + 5 * Date.ONE_HOUR).toTimeString());
// -->
</script>