• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

modules/dateplaner/classes/class.TimestampToDate.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                                                                                       |
00005         |       Dateplaner Modul                                                                                                                  |                                                                                                     
00006         +-----------------------------------------------------------------------------+
00007         | Copyright (c) 2004 ILIAS open source & University of Applied Sciences Bremen|
00008         |                                                                             |
00009         | This program is free software; you can redistribute it and/or               |
00010         | modify it under the terms of the GNU General Public License                 |
00011         | as published by the Free Software Foundation; either version 2              |
00012         | of the License, or (at your option) any later version.                      |
00013         |                                                                             |
00014         | This program is distributed in the hope that it will be useful,             |
00015         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00016         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00017         | GNU General Public License for more details.                                |
00018         |                                                                             |
00019         | You should have received a copy of the GNU General Public License           |
00020         | along with this program; if not, write to the Free Software                 |
00021         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
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; // schaltjahr
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     } /* END timestamp_to_date */
00107 
00108 ?>

Generated on Fri Dec 13 2013 09:06:37 for ILIAS Release_3_4_x_branch .rev 46804 by  doxygen 1.7.1