/** * Return converted into user time current timestamp * * @return integer */ public static function getUserTime() { if (!isset(static::$userTime)) { static::$userTime = \XLite\Core\Converter::convertTimeToUser(); } return static::$userTime; }
/** * Add attribute 'data-end-date' to input field * * @return array */ protected function getCommonAttributes() { $result = parent::getCommonAttributes(); $result['data-end-date'] = date('Y-m-d', \XLite\Core\Converter::convertTimeToUser()); return $result; }
/** * Format day time * * @param integer $base UNIX time stamp OPTIONAL * @param string $format Format string OPTIONAL * @param boolean $convertToUserTimeZone True if time value should be converted according to the time zone OPTIONAL * * @return string */ public static function formatDayTime($base = null, $format = null, $convertToUserTimeZone = true) { if (!$format) { $format = \XLite\Core\Config::getInstance()->Units->time_format; } if ($convertToUserTimeZone) { $base = \XLite\Core\Converter::convertTimeToUser($base); } return static::getStrftime($format, $base); }
/** * Get arrival date * * @return integer */ public function getArrivalDate() { if ($this->getId()) { $date = $this->arrivalDate; } elseif (!$this->arrivalDate) { $date = time(); } else { $date = $this->arrivalDate; } return \XLite\Core\Converter::convertTimeToUser($date); }