Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00038 class TimestampToDate {
00039
00040
00049 function ttd($timestamp) {
00050
00051 global $DP_language;
00052
00053 $tdd = date("d:w:m:Y:H:i:s",$timestamp);
00054
00055 $months = array("01"=>$DP_language[long_01],"02"=>$DP_language[long_02],"03"=>$DP_language[long_03],"04"=>$DP_language[long_04],"05"=>$DP_language[long_05],"06"=>$DP_language[long_06],"07"=>$DP_language[long_07],"08"=>$DP_language[long_08],"09"=>$DP_language[long_09],"10"=>$DP_language[long_10],"11"=>$DP_language[long_11],"12"=>$DP_language[long_12]);
00056
00057 $days = array("0"=>$DP_language[Mo_long],"1"=>$DP_language[Tu_long],"2"=>$DP_language[We_long],"3"=>$DP_language[Th_long],"4"=>$DP_language[Fr_long],"5"=>$DP_language[Sa_long],"6"=>$DP_language[Su_long]);
00058
00059 list($monthsday, $day,$month,$year,$hour,$minute,$second) = explode(":",$tdd);
00060
00061 $this->addEng = date("S",$timestamp);
00062 $this->weekday = $days[$day-1];
00063 $this->weeknumber = date("W",$timestamp);
00064 $this->weekdaynumber = date("w",$timestamp);
00065 $this->monthname = $months[$month];
00066 $this->monthnumber = date("n",$timestamp);
00067 $this->monthnumber_long = date("m",$timestamp);
00068 $this->hour_long = date("H",$timestamp);
00069 $this->hour_short = date("G",$timestamp);
00070 $this->minutes = date("i",$timestamp);
00071 $this->seconds = date("s",$timestamp);
00072 $this->day_of_month = date("d",$timestamp);
00073 $this->day_of_month_short = date("j",$timestamp);
00074 $this->day_of_year = date("z",$timestamp)+1;
00075 $this->days_in_month = date("t",$timestamp);
00076 $this->year_long = date("Y",$timestamp);
00077 $this->year_short = date("y",$timestamp);
00078 $this->day_ampm = date("a",$timestamp);
00079 $leapyear = (date("L",$timestamp)) ? "0" : "1";
00080 $this->leapyear = $leapyear;
00081
00082 $Date_format_middle = $DP_language[date_format_middle];
00083 switch($Date_format_middle) {
00084 case 'd/m/y':
00085 $this->longtime = "$this->day_of_month_short. $months[$month] $year / $hour:$minute:$second $sl_language[hour] ";
00086 $this->middletime = "$this->day_of_month_short. $months[$month] $year / $hour:$minute $sl_language[hour] ";
00087 $this->shorttime = "$this->day_of_month_short. $months[$month] $year";
00088 $this->extrashorttime = "$this->day_of_month_short.$this->monthnumber_long.<BR>$year";
00089 break;
00090 case 'm/d/y':
00091 $this->longtime = "$months[$month] $this->day_of_month_short$this->addEng $year / $hour:$minute:$second $sl_language[hour] ";
00092 $this->middletime = "$months[$month] $this->day_of_month_short$this->addEng $year / $hour:$minute $sl_language[hour] ";
00093 $this->shorttime = "$months[$month] $this->day_of_month_short$this->addEng $year";
00094 $this->extrashorttime = "$this->monthnumber_long/$this->day_of_month_short/<BR>$year";
00095 break;
00096 default :
00097 $this->longtime = "$this->day_of_month_short. $months[$month] $year / $hour:$minute:$second $sl_language[hour] ";
00098 $this->middletime = "$this->day_of_month_short. $months[$month] $year / $hour:$minute $sl_language[hour] ";
00099 $this->shorttime = "$this->day_of_month_short. $months[$month] $year";
00100 $this->extrashorttime = "$this->day_of_month_short.$this->monthnumber_long.<BR>$year";
00101 break;
00102 }
00103
00104 }
00105
00106 }
00107
00108 ?>