year = $year; $this->month = $month; $this->day = $day; $this->hour = $hour; $this->minute = $minute; $this->second = $second; $this->ampm = $ampm; $this->daySavingsAdjust = $daySavingsAdjust; $this->timezone = $timezone; $this->ntp = $ntp; $this->ntp_1 = $ntp_1; $this->ntp_2 = $ntp_2; $this->usingCustomTZ = $usingCustomTZ; $this->customTZHourOffset = $customTZHourOffset; $this->customTZMinuteOffset = $customTZMinuteOffset; } }; //define the constant values that will populate the lists $months_array = array("1"=>"January", "2"=>"February", "3"=>"March", "4"=>"April", "5"=>"May", "6"=>"June", "7"=>"July", "8"=>"August", "9"=>"September", "10"=>"October", "11"=>"November", "12"=>"December"); $months_array31 = array("1"=>"January", "3"=>"March", "5"=>"May", "7"=>"July", "8"=>"August", "10"=>"October", "12"=>"December"); $daytimes = array("AM","PM"); for($d=1;$d<=31;$d++) { if($d<10) { $days_array31[$d]="0$d"; $days_array29[$d]="0$d"; $days_array28[$d]="0$d"; $days_array30[$d]="0$d"; continue; } $days_array31[$d] = $d; if($d<30) { $days_array29[$d]=$d; if($d!=29) { $days_array28[$d]=$d; } } if($d!=31) { $days_array30[$d]=$d; } } for($i=0;$i<60;$i++) { if($i<10) { $min_sec[$i] = "0$i"; continue; } $min_sec[$i] = $i; } for($i=1;$i<=12;$i++) { if($i<10) { $hours[$i] = "0$i"; continue; } $hours[$i] = $i; } // get the stored date & time to display $date = get_date_and_time($user); $timezones = get_timezones($user); $month1 = $months_array[$date->month]; if ($date->day < 10) { $day1 = "0$date->day"; } else { $day1 = $date->day; } $year1 = $date->year; if(in_array($month1, $months_array31)) { $days_array=$days_array31; } else if (strcmp($month1,"February") == 0) { if ($year1%4 == 0) { $days_array = $days_array29; } else { $days_array = $days_array28; } } else { $days_array = $days_array30; } if($date->hour < 12) { if($date->hour == 0) { $hour1 = "12"; } else { if($date->hour < 10) { $hour1 = "0$date->hour"; } else { $hour1 = $date->hour; } } $day_time1 = "AM"; } else if($date->hour >= 12) { if($date->hour == 12) { $hour1 = $date->hour; } else { $hour1 = $date->hour - 12; settype($hour1, "string"); } $day_time1="PM"; } error_log("$date_hour:".$date_hour." type:". gettype($date_hour)); if($date->minute<10) { $min1 = "0$date->minute"; } else { $min1 = $date->minute; } if($date->second) { $sec1 = "0$date->second"; } else { $sec1 = $date->second; } $timezone = $date->timezone; $date_time_text = $month1.' '.$day1.', '.$year1.' '.$hour1.':'.$min1.':'.$sec1.' '.$day_time1.' '.$timezone; ?>