Example #1
0
 /**
  * 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;
 }
Example #2
0
 /**
  * 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;
 }
Example #3
0
 /**
  * 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);
 }
Example #4
0
 /**
  * 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);
 }