コード例 #1
0
 /**
  * Set current store locale by default
  * @see parent::__construct()
  */
 public function __construct($date = null, $part = null, $locale = null)
 {
     if ($locale == null) {
         $locale = Mage::app()->getLocale()->getLocale();
     }
     return parent::__construct($date, $part, $locale);
 }
コード例 #2
0
ファイル: Date.php プロジェクト: rommmka/axiscommerce
 /**
  * Constructor
  * @param  string|integer|Zend_Date|array  $date    OPTIONAL Date value or value of date part to set
  *                                                 ,depending on $part. If null the actual time is set
  * @param  string                          $part    OPTIONAL Defines the input format of $date
  * @param  string|Zend_Locale              $locale  OPTIONAL Locale for parsing input
  * @return Axis_Date
  * @throws Zend_Date_Exception
  */
 public function __construct($date = null, $part = null, $locale = null)
 {
     if (null === $locale) {
         $locale = Axis_Locale::getLocale();
     }
     // supress notice about PCRE without UTF8 support
     @parent::__construct($date, $part, $locale);
 }
コード例 #3
0
ファイル: Date.php プロジェクト: pago/pantr
 public function __construct($date = null, $part = null, $locale = null)
 {
     if (!is_null(self::$frozenNow) && is_null($date) && is_null($part) && is_null($locale)) {
         parent::__construct(self::$frozenNow);
     } else {
         parent::__construct($date, $part, $locale);
     }
 }
コード例 #4
0
 /**
  * Does exactly what Zend_Date does except that after setting the intial date/time
  * we check to see if it contains times that are known to be "TBA" for events
  * such as Event Inventory's '23:59:20' and '23:59:59' and if so it resets
  * the time to be '00:00:00' which is what we use as TBA.
  *
  * @param  string|integer|Zend_Date|array  $date    OPTIONAL Date value or value of date part to set
  *                                                 ,depending on $part. If null the actual time is set
  * @param  string                          $part    OPTIONAL Defines the input format of $date
  * @param  string|Zend_Locale              $locale  OPTIONAL Locale for parsing input
  * @return Zend_Date
  * @throws Zend_Date_Exception
  */
 public function __construct($date = null, $part = null, $locale = null)
 {
     parent::__construct($date, $part, $locale);
     if ($this->get('HH:mm') === '23:59' || $this->get('HH:mm') === '03:30') {
         // 23:59 is an EventInventory TBA time
         // 03:30 is a TicketNetwork TBA time
         // Set the time to '00:00:00'
         $this->set($this->get(self::DATES));
     }
 }
コード例 #5
0
 public function __construct($date = null, $part = null, $locale = null)
 {
     $this->setTimezone('Europe/Paris');
     parent::__construct($date, $part, $locale);
 }
コード例 #6
0
 /**
  * Generates the standard date object, could be a unix timestamp, localized date,
  * string, integer, array and so on. Also parts of dates or time are supported
  * Always set the default timezone: http://php.net/date_default_timezone_set
  * For example, in your bootstrap: date_default_timezone_set('America/Los_Angeles');
  * For detailed instructions please look in the docu.
  *
  * @param  string|integer|\Magento\Framework\Stdlib\DateTime\DateInterface|array $date OPTIONAL Date value or value
  *         of date part to set, depending on $part. If null the actual time is set
  * @param  string $part OPTIONAL Defines the input format of $date
  * @param  string|\Magento\Framework\Stdlib\DateTime\DateInterface $locale OPTIONAL Locale for parsing input
  * @return \Magento\Framework\Stdlib\DateTime\DateInterface
  * @throws Zend_Date_Exception
  */
 public function __construct($date = null, $part = null, $locale = null)
 {
     parent::__construct($date, $part, $locale);
 }
コード例 #7
0
ファイル: Date.php プロジェクト: riteshsahu1981/Weadvance
 public function __construct($date = null, $part = null, $locale = null)
 {
     parent::__construct($date = null, $part = null, $locale = null);
     $this->setTimezone('Asia/Calcutta');
 }
コード例 #8
0
ファイル: Date.php プロジェクト: GemsTracker/MUtil
 /**
  * Generates the standard date object, could be a unix timestamp, localized date,
  * string, integer, array and so on. Also parts of dates or time are supported
  * Always set the default timezone: http://php.net/date_default_timezone_set
  * For example, in your bootstrap: date_default_timezone_set('America/Los_Angeles');
  * For detailed instructions please look in the docu.
  *
  * @param  string|integer|Zend_Date|array  $date    OPTIONAL Date value or value of date part to set
  *                                                 ,depending on $part. If null the actual time is set
  * @param  string                          $part    OPTIONAL Defines the input format of $date
  * @param  string|Zend_Locale              $locale  OPTIONAL Locale for parsing input
  * @return Zend_Date
  * @throws Zend_Date_Exception
  */
 public function __construct($date = null, $part = null, $locale = null)
 {
     $notset = true;
     if (null == $locale) {
         if (is_string($date) && is_string($part) && isset(self::$zendToPhpFormats[$part])) {
             $phpDate = \DateTime::createFromFormat(self::$zendToPhpFormats[$part], $date);
             if ($phpDate) {
                 $date = $phpDate;
             }
         } elseif (null == $date && null == $part) {
             $this->setLocale();
             $zone = @date_default_timezone_get();
             $this->setTimezone($zone);
             $this->setUnixTimestamp(time());
             $notset = false;
         }
     }
     if ($date instanceof \DateTime) {
         $this->setLocale();
         $this->setTimezone($date->getTimezone()->getName());
         $this->setUnixTimestamp($date->getTimestamp());
         $notset = false;
     }
     if ($notset) {
         parent::__construct($date, $part, $locale);
     }
 }
コード例 #9
0
ファイル: Day.php プロジェクト: robjacoby/xlr8u
 /**
  * Generates the standard date object, could be a unix timestamp, localized date,
  * string, integer, array and so on. Also parts of dates or time are supported
  * Always set the default timezone: http://php.net/date_default_timezone_set
  * For example, in your bootstrap: date_default_timezone_set('America/Los_Angeles');
  * For detailed instructions please look in the documentation.
  *
  * @param  SZend_Calendar $calendar					Instance of SZend_Calendar the day belongs to
  * @param  string|integer|Zend_Date|array  $date    OPTIONAL Date value or value of date part to set
  * ,depending on $part. If null the actual time is set
  * @param  string                          $part    OPTIONAL Defines the input format of $date
  * @param  string|Zend_Locale              $locale  OPTIONAL Locale for parsing input
  * @return Zend_Date
  * @throws Zend_Date_Exception
  */
 public function __construct($date = null, $part = null, $locale = null, $class = null)
 {
     parent::__construct($date, $part, $locale);
     $this->_class = $class;
 }