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

calendar/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 
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; // schaltjahr
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     } /* END timestamp_to_date */
00104 
00105 ?>

Generated on Fri Dec 13 2013 17:56:47 for ILIAS Release_3_9_x_branch .rev 46835 by  doxygen 1.7.1