Piwik\Date::getDateEndUTC PHP Method

getDateEndUTC() public method

Returns the end of the day of the current timestamp in UTC. For example, if the current timestamp is '2007-07-24 14:03:24' in UTC, the result will be '2007-07-24 23:59:59'.
public getDateEndUTC ( ) : string
return string
    public function getDateEndUTC()
    {
        $dateEndUTC = gmdate('Y-m-d 23:59:59', $this->timestamp);
        $date = Date::factory($dateEndUTC)->setTimezone($this->timezone);
        return $date->toString(self::DATE_TIME_FORMAT);
    }

Usage Example

Esempio n. 1
0
 protected static function determineIfArchivePermanent(Date $dateEnd)
 {
     $now = time();
     $endTimestampUTC = strtotime($dateEnd->getDateEndUTC());
     if ($endTimestampUTC <= $now) {
         // - if the period we are looking for is finished, we look for a ts_archived that
         //   is greater than the last day of the archive
         return $endTimestampUTC;
     }
     return false;
 }
All Usage Examples Of Piwik\Date::getDateEndUTC