Here's my poor attempt to display timezone differences to the user. Add the script to the end of the StandardFooter.asp page.

What you need to do: the variable wugGMTOffset must be set to the GMT offset where the wug machine resides. The value 8 indicates my Pacific zone.

This script can obtain the clock from the wug machine and display it with a local time offset, but the seconds will always read 0 (the wug clock doesn't provide the seconds)
You might chose to display that time as a guard against the clock of the browser being off.


The script shown will display the local clock that is derived from the browser.



<h4>
<script language="javascript">
        var wugGMTOffset = 8;
        var wugTime = "<%time% current_time>"
        var wugHours = wugTime.substring(0,2);
        var wugMinutes = wugTime.substring(3,5);

        var wugDate = "<%time% current_date>"
        var wugYear = wugDate.substring(0,4);
        var wugMonth = wugDate.substring(5,7);
        var wugDay = wugDate.substring(8,10);

var wugMonthx = wugMonth -1;

var wuglocalTime = new Date(wugYear,wugMonthx,wugDay,wugHours,wugMinutes);
var localTime = new Date();
var localGMTOffset = localTime.getTimezoneOffset() /60;


// If you use wuglocalTime.toLocaleString, you get the clock from WUG's clock displayed with the local time offset
// but the seconds portion will always display 00.


document.write(localTime.toLocaleString());
document.write("<BR>" + " GMT Time Zone Offset is " + localGMTOffset + " " + "Hours");


document.write("<BR>" + " The Timezone difference between WUG and this station is " + (localGMTOffset - wugGMTOffset) + " " + "Hours");
</script>
</h4>


Jay Drew


Please visit http://www.ipswitch.com/support/mailing-lists.html to be removed from this list.


An Archive of this list is available at:
http://www.mail-archive.com/whatsup_forum%40list.ipswitch.com/

Reply via email to