Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Piatok, 19. apríl 2024

Rozdiely pre Metafox/lib/Date.php medzi verziami 1.1 a 1.2

verzia 1.1, 2005/06/05 12:13:52 verzia 1.2, 2005/11/07 20:37:10
Riadok 1 
Riadok 1 
 <?php  <?php
 /* vim: set expandtab tabstop=4 shiftwidth=4: */  
 // +----------------------------------------------------------------------+  /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
 // | PHP Version 4                                                        |  
 // +----------------------------------------------------------------------+  /**
 // | Copyright (c) 1997-2003 The PHP Group                                |   * Generic date handling class for PEAR
 // +----------------------------------------------------------------------+   *
 // | This source file is subject to version 2.02 of the PHP license,      |   * Generic date handling class for PEAR.  Attempts to be time zone aware
 // | that is bundled with this package in the file LICENSE, and is        |   * through the Date::TimeZone class.  Supports several operations from
 // | available at through the world-wide-web at                           |   * Date::Calc on Date objects.
 // | http://www.php.net/license/2_02.txt.                                 |   *
 // | If you did not receive a copy of the PHP license and are unable to   |   * PHP versions 4 and 5
 // | obtain it through the world-wide-web, please send a note to          |   *
 // | license@php.net so we can mail you a copy immediately.               |   * LICENSE: This source file is subject to version 2.02 of the PHP license
 // +----------------------------------------------------------------------+   * that is available through the world-wide-web at the following URI:
 // | Authors: Baba Buehler <baba@babaz.com>                               |   * http://www.php.net/license/2_02.txt.  If you did not receive a copy of
 // |          Pierre-Alain Joye <pajoye@php.net>                          |   * the PHP License and are unable to obtain it through the web, please
 // +----------------------------------------------------------------------+   * send a note to license@php.net so we can mail you a copy immediately.
 //   *
 // $Id$   * @category   Date and Time
    * @package    Date
    * @author     Baba Buehler <baba@babaz.com>
    * @author     Pierre-Alain Joye <pajoye@php.net>
    * @copyright  1997-2005 The PHP Group
    * @license    http://www.php.net/license/2_02.txt  PHP License
    * @version    CVS: $Id$
    * @link       http://pear.php.net/package/Date
    */
   
 /**@#+  /**@#+
  * Include supporting classes   * Include supporting classes
Riadok 57  define('DATE_FORMAT_UNIXTIME', 5);
Riadok 65  define('DATE_FORMAT_UNIXTIME', 5);
 /**@#-*/  /**@#-*/
   
 /**  /**
  * Generic date handling class for PEAR.   * Generic date handling class for PEAR
  *   *
  * Generic date handling class for PEAR.  Attempts to be time zone aware   * Generic date handling class for PEAR.  Attempts to be time zone aware
  * through the Date::TimeZone class.  Supports several operations from   * through the Date::TimeZone class.  Supports several operations from
  * Date::Calc on Date objects.   * Date::Calc on Date objects.
  *   *
  * @author Baba Buehler <baba@babaz.com>   * @author     Baba Buehler <baba@babaz.com>
  * @package Date   * @author     Pierre-Alain Joye <pajoye@php.net>
  * @access public   * @copyright  1997-2005 The PHP Group
    * @license    http://www.php.net/license/2_02.txt  PHP License
    * @version    Release: 1.4.5
    * @link       http://pear.php.net/package/Date
  */   */
 class Date  class Date
 {  {
Riadok 104  class Date
Riadok 115  class Date
      * @var float       * @var float
      */       */
     var $partsecond;      var $partsecond;
   
     /**      /**
      * timezone for this date       * timezone for this date
      * @var object Date_TimeZone       * @var object Date_TimeZone
      */       */
     var $tz;      var $tz;
   
       /**
        * define the default weekday abbreviation length
        * used by ::format()
        * @var int
        */
       var $getWeekdayAbbrnameLength = 3;
   
   
     /**      /**
      * Constructor       * Constructor
Riadok 309  class Date
Riadok 328  class Date
                 $nextchar = substr($format,$strpos + 1,1);                  $nextchar = substr($format,$strpos + 1,1);
                 switch ($nextchar) {                  switch ($nextchar) {
                 case "a":                  case "a":
                     $output .= Date_Calc::getWeekdayAbbrname($this->day,$this->month,$this->year);                      $output .= Date_Calc::getWeekdayAbbrname($this->day,$this->month,$this->year, $this->getWeekdayAbbrnameLength);
                     break;                      break;
                 case "A":                  case "A":
                     $output .= Date_Calc::getWeekdayFullname($this->day,$this->month,$this->year);                      $output .= Date_Calc::getWeekdayFullname($this->day,$this->month,$this->year);
Riadok 338  class Date
Riadok 357  class Date
                 case "H":                  case "H":
                     $output .= sprintf("%02d", $this->hour);                      $output .= sprintf("%02d", $this->hour);
                     break;                      break;
                   case 'h':
                       $output .= sprintf("%d", $this->hour);
                       break;
                 case "I":                  case "I":
                     $hour = ($this->hour + 1) > 12 ? $this->hour - 12 : $this->hour;                      $hour = ($this->hour + 1) > 12 ? $this->hour - 12 : $this->hour;
                     $output .= sprintf("%02d", $hour==0 ? 12 : $hour);                      $output .= sprintf("%02d", $hour==0 ? 12 : $hour);
                     break;                      break;
                   case "i":
                       $hour = ($this->hour + 1) > 12 ? $this->hour - 12 : $this->hour;
                       $output .= sprintf("%d", $hour==0 ? 12 : $hour);
                       break;
                 case "j":                  case "j":
                     $output .= Date_Calc::julianDate($this->day,$this->month,$this->year);                      $output .= Date_Calc::julianDate($this->day,$this->month,$this->year);
                     break;                      break;
Riadok 384  class Date
Riadok 410  class Date
                     $output .= sprintf("%02d:%02d", $this->hour, $this->minute);                      $output .= sprintf("%02d:%02d", $this->hour, $this->minute);
                     break;                      break;
                 case "s":                  case "s":
                     $output .= sprintf("%02f", (float)((float)$this->second + $this->partsecond));                      $output .= str_replace(',', '.', sprintf("%09f", (float)((float)$this->second + $this->partsecond)));
                     break;                      break;
                 case "S":                  case "S":
                     $output .= sprintf("%02d", $this->second);                      $output .= sprintf("%02d", $this->second);
Riadok 1046  class Date
Riadok 1072  class Date
      */       */
     function getYear()      function getYear()
     {      {
         return $this->year;          return (int)$this->year;
     }      }
   
     /**      /**
Riadok 1059  class Date
Riadok 1085  class Date
      */       */
     function getMonth()      function getMonth()
     {      {
         return $this->month;          return (int)$this->month;
     }      }
   
     /**      /**
Riadok 1215  class Date
Riadok 1241  class Date
             $this->second = $s;              $this->second = $s;
         }          }
     }      }
   }
   
 } // Date  
   
   
 //  
 // END  
 ?>  ?>

Legend:
Odstranené z verzie1.1  
zmenené riadky
  Pridané vo verzii1.2

Platon Group <platon@platon.sk> http://platon.sk/
Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok