function time_zone () {

  // STEP ONE: set arays

  var strMonths = new Array();
    strMonths[0]  = "January";
    strMonths[1]  = "February";
    strMonths[2]  = "March";
    strMonths[3]  = "April";
    strMonths[4]  = "May";
    strMonths[5]  = "June";
    strMonths[6]  = "July";
    strMonths[7]  = "August";
    strMonths[8]  = "September";
    strMonths[9]  = "October";
    strMonths[10] = "November";
    strMonths[11] = "December";
  var strDay = new Array();
    strDay[0]  = "Sunday";
    strDay[1]  = "Monday";
    strDay[2]  = "Tuesday";
    strDay[3]  = "Wednesday";
    strDay[4]  = "Thursday";
    strDay[5]  = "Friday";
    strDay[6]  = "Saturday";


  // STEP TWO: define time object

  var today = new Date() ; 


  // STEP THREE: retrieve various time elements

  var day   = today.getDay() ; 
  var month = today.getMonth() ; 
  var date  = today.getDate() ; 
  var year  = today.getFullYear() ; 
  var hours = today.getHours();
  var min   = today.getMinutes();
  var sec   = today.getSeconds() ; 
  var TZ    = today.getTimezoneOffset() / 60;


  // STEP FOUR: format individual time elements

  if (min < 10) { strMin = "0" + min } else strMin = min ; 
  if (sec < 10) { strSec = "0" + sec } else strSec = sec ; 
  w3cMonth = month + 1 ; 
  if (w3cMonth < 10) { w3cMonth = "0" + w3cMonth }


  if (hours > 9) { w3cHours = hours } else { w3cHours = "0" + hours }  

  if (hours > 12) {
    hours12=hours-12 ; 
    ampm = " p.m." } 
  else { 
    hours12=hours ; 
    if (hours==12) { ampm = " p.m." }
    else { ampm  = " a.m." }
  } 
  TZ = ( navigator.appname=="Netscape" && version_minor <= 4.05 ) ?  TZ + 1 : TZ;
  if (TZ = 4) {TimeZone="EDST (Albany, N.Y.)"} else if (TZ = 5){TimeZone="EST (Albany, N.Y.)"} else {TimeZone = TZ + "offset from Zulu"}


  // STEP FIVE: create output variable

  day_date= "raw (directly printed): " +today+ "<br />raw (parsed): " + day + "~" + month + "~" + date + "~" + year + "~" + hours + "~" + min + "~" + sec + "~" + TZ + "<br />formatted: " + strDay[day] + ", " + strMonths[month] + " " + date + " " + year + ", " + hours + ":" + strMin + ":"  + strSec + " " + TimeZone +  " (-0" + TZ + ":00)<br />W3C Standard: " + year + "-" + w3cMonth + "-" + date + "-" + "T" + w3cHours + ":" + strMin + ":" + strSec + "-0" + TZ + ":00<br />Time in 12 Hour format: " + hours12 + ":" + strMin + ":" + strSec + ampm  ; 


  // STEP SIX: output the results of the function

  return ( day_date ); 

}

