/**
  * 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);
 }
Example #2
0
 /**
  * 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);
 }
Example #3
0
File: Date.php Project: 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);
     }
 }
 /**
  * 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));
     }
 }
 public function __construct($date = null, $part = null, $locale = null)
 {
     $this->setTimezone('Europe/Paris');
     parent::__construct($date, $part, $locale);
 }
Example #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);
 }
Example #7
0
 public function __construct($date = null, $part = null, $locale = null)
 {
     parent::__construct($date = null, $part = null, $locale = null);
     $this->setTimezone('Asia/Calcutta');
 }
Example #8
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|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);
     }
 }
Example #9
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 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;
 }