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
00035 class TimestampToDate {
00036
00037
00046 function ttd($timestamp) {
00047
00048 global $DP_language;
00049
00050 $tdd = date("d:w:m:Y:H:i:s",$timestamp);
00051
00052 $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]);
00053
00054 $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]);
00055
00056 list($monthsday, $day,$month,$year,$hour,$minute,$second) = explode(":",$tdd);
00057
00058 $this->addEng = date("S",$timestamp);
00059 $this->weekday = $days[$day-1];
00060 $this->weeknumber = date("W",$timestamp);
00061 $this->weekdaynumber = date("w",$timestamp);
00062 $this->monthname = $months[$month];
00063 $this->monthnumber = date("n",$timestamp);
00064 $this->monthnumber_long = date("m",$timestamp);
00065 $this->hour_long = date("H",$timestamp);
00066 $this->hour_short = date("G",$timestamp);
00067 $this->minutes = date("i",$timestamp);
00068 $this->seconds = date("s",$timestamp);
00069 $this->day_of_month = date("d",$timestamp);
00070 $this->day_of_month_short = date("j",$timestamp);
00071 $this->day_of_year = date("z",$timestamp)+1;
00072 $this->days_in_month = date("t",$timestamp);
00073 $this->year_long = date("Y",$timestamp);
00074 $this->year_short = date("y",$timestamp);
00075 $this->day_ampm = date("a",$timestamp);
00076 $leapyear = (date("L",$timestamp)) ? "0" : "1";
00077 $this->leapyear = $leapyear;
00078
00079 $Date_format_middle = $DP_language[date_format_middle];
00080 switch($Date_format_middle) {
00081 case 'd/m/y':
00082 $this->longtime = "$this->day_of_month_short. $months[$month] $year / $hour:$minute:$second $sl_language[hour] ";
00083 $this->middletime = "$this->day_of_month_short. $months[$month] $year / $hour:$minute $sl_language[hour] ";
00084 $this->shorttime = "$this->day_of_month_short. $months[$month] $year";
00085 $this->extrashorttime = "$this->day_of_month_short.$this->monthnumber_long.<BR>$year";
00086 break;
00087 case 'm/d/y':
00088 $this->longtime = "$months[$month] $this->day_of_month_short$this->addEng $year / $hour:$minute:$second $sl_language[hour] ";
00089 $this->middletime = "$months[$month] $this->day_of_month_short$this->addEng $year / $hour:$minute $sl_language[hour] ";
00090 $this->shorttime = "$months[$month] $this->day_of_month_short$this->addEng $year";
00091 $this->extrashorttime = "$this->monthnumber_long/$this->day_of_month_short/<BR>$year";
00092 break;
00093 default :
00094 $this->longtime = "$this->day_of_month_short. $months[$month] $year / $hour:$minute:$second $sl_language[hour] ";
00095 $this->middletime = "$this->day_of_month_short. $months[$month] $year / $hour:$minute $sl_language[hour] ";
00096 $this->shorttime = "$this->day_of_month_short. $months[$month] $year";
00097 $this->extrashorttime = "$this->day_of_month_short.$this->monthnumber_long.<BR>$year";
00098 break;
00099 }
00100
00101 }
00102
00103 }
00104
00105 ?>