[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch

title

Body

[close]

/vendor/zendframework/zend-stdlib/src/ -> DateTime.php (source)

   1  <?php
   2  /**
   3   * Zend Framework (http://framework.zend.com/)
   4   *
   5   * @link      http://github.com/zendframework/zf2 for the canonical source repository
   6   * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
   7   * @license   http://framework.zend.com/license/new-bsd New BSD License
   8   */
   9  
  10  namespace Zend\Stdlib;
  11  
  12  use DateTimeZone;
  13  
  14  trigger_error('DateTime extension deprecated as of ZF 2.1.4; use the \DateTime constructor to parse extended ISO8601 dates instead', E_USER_DEPRECATED);
  15  
  16  /**
  17   * DateTime
  18   *
  19   * An extension of the \DateTime object.
  20   *
  21   * @deprecated
  22   */
  23  class DateTime extends \DateTime
  24  {
  25      /**
  26       * The DateTime::ISO8601 constant used by php's native DateTime object does
  27       * not allow for fractions of a second. This function better handles ISO8601
  28       * formatted date strings.
  29       *
  30       * @param  string       $time
  31       * @param  DateTimeZone $timezone
  32       * @return mixed
  33       */
  34      public static function createFromISO8601($time, DateTimeZone $timezone = null)
  35      {
  36          $format = self::ISO8601;
  37          if (isset($time[19]) && $time[19] === '.') {
  38              $format = 'Y-m-d\TH:i:s.uO';
  39          }
  40  
  41          if ($timezone !== null) {
  42              return self::createFromFormat($format, $time, $timezone);
  43          }
  44  
  45          return self::createFromFormat($format, $time);
  46      }
  47  }


Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1