本文整理汇总了PHP中Zend_Date::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Date::__construct方法的具体用法?PHP Zend_Date::__construct怎么用?PHP Zend_Date::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Date
的用法示例。
在下文中一共展示了Zend_Date::__construct方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* 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: __construct
/**
* 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: __construct
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: __construct
/**
* 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: __construct
public function __construct($date = null, $part = null, $locale = null)
{
$this->setTimezone('Europe/Paris');
parent::__construct($date, $part, $locale);
}
示例6: __construct
public function __construct($date = null, $part = null, $locale = null)
{
parent::__construct($date = null, $part = null, $locale = null);
$this->setTimezone('Asia/Calcutta');
}
示例7: __construct
/**
* 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);
}
}
示例8: __construct
/**
* 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;
}