function getPacificTime(){ //returns array with hours, minutes and seconds
   	
    var d = new Date();
    var t = [];

    var UTCHours = d.getUTCHours(); //get UTC hours
    var pacificOffset = 21;

	t['month'] = d.getMonth();
    t['day'] = d.getDay();
    t['date'] = d.getDate(); //day of the month 0 -31

	
	(isDSTinNorthAmerica())? dst = 1  : dst = 0;

    var curHours = UTCHours - pacificOffset;

	if(curHours < 0){
		
		curHours = 24 + curHours;

	}

    (curHours + dst > 11 && curHours < 24)? ampm = 'pm' : ampm = 'am';
	
    if(curHours < 0)  curHours = 24 + curHours;
    if(curHours > 12) curHours = curHours - 12;
	
	var q = curHours - dst;
	
	if(q == 0) q = 12;

    t['date'] = d.getDate(); //day of the month 0 -31
    t['hours'] = q;
    t['minutes'] = d.getMinutes();
    t['seconds'] = d.getSeconds();
    t['ampm'] = ampm;
	
    return t;
}

function getEastCoastTime(){

    var d = new Date();
    var t = [];

    var UTCHours = d.getUTCHours(); //get UTC hours
    var eastOffset = 4;

	t['month'] = d.getMonth();
    t['day'] = d.getDay();
    t['date'] = d.getDate(); //day of the month 0 -31

    var curHours = UTCHours - eastOffset;

	if(curHours < 0){

        curHours = 24 + curHours;

    }


	(isDSTinNorthAmerica())? dst = 1  : dst = 0;

    (curHours + dst > 11 && curHours < 24)? ampm = 'pm' : ampm = 'am';

    if(curHours < 0)  curHours = 24 + curHours;
    if(curHours > 12) curHours = curHours - 12;

	var q = curHours - dst;

	if(q == 0) q = 12;
    t['date'] = d.getDate(); //day of the month 0 -31
    t['hours'] = q;
    t['minutes'] = d.getMinutes();
    t['seconds'] = d.getSeconds();
    t['ampm'] = ampm;

    return t;

}

function getUserTime(){

    var d = new Date();
    var t = [];
    t['hours'] = d.getHours();
    t['minutes'] = d.getMinutes();
    t['seconds'] = d.getSeconds();

    (t['hours'] < 12)? t['ampm'] = 'am' : t['ampm'] = 'pm';

    return t;


}

function getEuroTime(){

    var d = new Date();
    var t = [];

    var UTCHours = d.getUTCHours(); //get UTC hours
    var euroOffset = -2;

	t['month'] = d.getMonth();
	t['day'] = d.getDay();
	t['date'] = d.getDate(); //day of the month 0 -31

	(isDSTinEurope)? dst = 1 : dst = 0;
		
	var curHours = UTCHours - euroOffset;
	
    (curHours + dst > 11 && curHours < 24)? ampm = 'pm' : ampm = 'am';

    if(curHours < 0)  curHours = 24 + curHours;
    if(curHours > 12) curHours = curHours - 12;

	var q = curHours - dst;

	if(q ==0) q = 12;

    t['date'] = d.getDate(); //day of the month 0 -31
    t['hours'] = q;
    t['minutes'] = d.getMinutes();
    t['seconds'] = d.getSeconds();
	t['ampm'] = ampm;

    return t;


}
//returns true or false.  Checks if it's daylight savings time

function isDSTinNorthAmerica(){

	var d = new Date();
	var date = d.getDate();
	var day = d.getDay();
	var month = d.getMonth();
		
	if(month < 3 || month > 9){ //if march or ealier or nov or later

		if(month == 2 || month == 10){ //if it's march or nov

			if(month == 2){ //mar

				if(date > 7 && date < 14){ //looking to get 2nd sunday, second sunday cannot occur before the 8th. and not after the 15th

					var diff = 6 - day; //differential to the end of the week

					if(date + diff > 13){ 

						return true; //the second sunday has already occurred 		
					}else{

						return false; //the second sunday has no occurred yet

					}

				}
		
			}else{ //nov

				if(date < 7){

					var diff = 6 - day;
					
					if(date + diff > 6){
						
						return true;

					}else{

						return false;

					}

				}else{

					return true;

				}
			

			}

		}else{ //we're in dst

			return true;

		}		

	}else{ //we're not in dst

		return false;

	}
}
//returns true or false, dst last sunday in oct and first sun in mar
function isDSTinEurope(){

	var d = new Date();
    var date = d.getDate();
    var day = d.getDay();
    var month = d.getMonth();

	 if(month < 3 || month > 8){ //if march or ealier or oct or later

        if(month == 2 || month == 9){ //if it's march or oct

            if(month == 2){ //mar

                if(date < 7){ //looking to get 2nd sunday, second sunday cannot occur before the 8th. and not after the 15th

                    var diff = 6 - day; //differential to the end of the week

                    if(date + diff > 6){

                        return true; //the second sunday has already occurred
                    }else{

                        return false; //the second sunday has no occurred yet

                    }

                }

            }else{ //oct

                if(date > 23){
					
                    var diff = 6 - day;
				
                    if(date + diff > 30){

                        return true;

                    }else{

                        return false;

                    }

                }else{

                    return true;

                }


            }

        }else{ //we're in dst

            return true;

        }

    }else{ //we're not in dst

        return false;

    }

}

