本文整理汇总了PHP中Date::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Date::__construct方法的具体用法?PHP Date::__construct怎么用?PHP Date::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Date
的用法示例。
在下文中一共展示了Date::__construct方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($dateTime, DateTimeZone $zone = null)
{
parent::__construct($dateTime);
if ($zone) {
$this->dateTime->setTimezone($zone);
}
}
示例2: __construct
public function __construct($timestamp)
{
$month_day = date('j', $timestamp);
$month = date('n', $timestamp);
$year = date('Y', $timestamp);
$this->timestamp = $timestamp;
parent::__construct($month_day, $month, $year);
}
示例3: __construct
public function __construct($datetime = null, $tz = '')
{
parent::__construct($datetime);
if ($tz == '') {
$this->setTZ(w2PgetConfig('system_timezone', 'UTC'));
} else {
$this->setTZ($tz);
}
}
示例4: __construct
/**
* @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
*/
public function __construct(\Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate)
{
parent::__construct($localeDate);
$this->_localToNormalFilter = new \Zend_Filter_LocalizedToNormalized(['date_format' => $this->_localeDate->getDateTimeFormat(\IntlDateFormatter::SHORT)]);
$this->_normalToLocalFilter = new \Zend_Filter_NormalizedToLocalized(['date_format' => \Magento\Framework\Stdlib\DateTime::DATETIME_INTERNAL_FORMAT]);
}
示例5: __construct
/**
* Class constructor method
*
* @access public
*
* @return void
*/
public function __construct()
{
parent::__construct(current_time('timestamp'));
}
示例6: __construct
public function __construct(array $attributes = [])
{
parent::__construct($attributes + ['size' => 24, 'class' => 'datetime']);
}
示例7:
function __construct($name)
{
user_error('Datetime is deprecated. Use SSDatetime instead.', E_USER_NOTICE);
parent::__construct($name);
}
示例8: __construct
public function __construct($data = null)
{
parent::__construct($data);
}
示例9:
function __construct($time = null, $default_format = 'Y-m-d H:i:s')
{
parent::__construct($time, $default_format);
}
示例10: __construct
/**
* Constructor
*
* @param $name
* @param string $label
* @param array $attr
*/
public function __construct($name, $label = '', $from = null, $to = null, $formatDisplay = null, $formatStore = null, $attr = [])
{
parent::__construct($name, $label, $formatDisplay, $formatStore, $attr);
$this->setTo(is_null($to) ? $name . '_to' : $to);
$this->setFrom(is_null($from) ? $name . '_from' : $from);
}
示例11:
function __construct($name)
{
// Debug::show( 'Created SSDatetime: ' . $name );
parent::__construct($name);
}