Devuelve la diferencia de tiempo formateada
@return string
541986
private function getLogTime()
    {
        $diff = $this->microtime_diff($this->init);
        $format = gmdate("H:i:s",(int)$diff);
        $diff = sprintf("%01.5f", $diff);
        $format .= substr($diff,strpos((string)$diff,'.'));
        return $format;
    }
736388
public function toDateTime()
    {
        $datetime = new \DateTime();
        $datetime->setTimestamp($this->sec);

        $microSeconds = $this->truncateMicroSeconds($this->usec);
        if ($microSeconds > 0) {
            $datetime = \DateTime::createFromFormat('Y-m-d H:i:s.u', $datetime->format('Y-m-d H:i:s') . '.' . str_pad($microSeconds, 6, '0', STR_PAD_LEFT));
        }

        $datetime->setTimezone(new \DateTimeZone("UTC"));

        return $datetime;
    }
1274091
private function _getFormat(){
        $format = '';
        switch(strtoupper($this->format)){
            case 'PNG':
                $format = CINDrawing::IMG_FORMAT_PNG;
                break;
            case 'JPEG':
                $format = CINDrawing::IMG_FORMAT_JPEG;
                break;
            case 'GIF':
                $format = CINDrawing::IMG_FORMAT_GIF;
                break;
            case 'WBMP':
                $format = CINDrawing::IMG_FORMAT_WBMP;
                break;
            default:
                $format = CINDrawing::IMG_FORMAT_PNG;
                break;
        }
        return $format;
    }
1268720
public function getFormat()
    {
        $result = null;

        foreach (static::$_formats as $value => $media_types)
        {
            $media_type = $this->getContentType();

            if (in_array($media_type, (array)$media_types))
            {
                $result = $value;
                break;
            }
        }

        return $result;
    }
198768
public function updated_at_formatted()
    {
        return ucfirst(app(DateFactory::class)->make($this->wrappedObject->updated_at)->format($this->incidentDateFormat()));
    }
1073745
public function occurred_at_formatted()
    {
        return ucfirst($this->dates->make($this->wrappedObject->occurred_at)->format($this->incidentDateFormat()));
    }
1273042
protected function calculateAndFormatIndexingTime() {
        $indexingTime = time() - $this->startTime;
        if ($indexingTime > 3600) {
            // format hours
            $indexingTime = $indexingTime / 3600;
            $indexingTime = number_format($indexingTime, 2, ',', '.');
            $indexingTime .= ' hours';
        } else {
            if ($indexingTime > 60) {
                // format minutes
                $indexingTime = $indexingTime / 60;
                $indexingTime = number_format($indexingTime, 2, ',', '.');
                $indexingTime .= ' minutes';
            } else {
                $indexingTime .= ' seconds';
            }
        }

        return $indexingTime;
    }
1270406
public function getPrettyString()
    {
        $out = $this->translator->translate('General_DateRangeFromTo', array($this->getDateStart()->toString(), $this->getDateEnd()->toString()));
        return $out;
    }
102636
public function getDateFormat()
    {
        $formatter = new IntlDateFormatter(
            $this->getLocale(),
            IntlDateFormatter::MEDIUM,
            IntlDateFormatter::NONE
        );
        $format = $formatter->getPattern();

        $this->extend('updateDateFormat', $format);

        return $format;
    }
382725
private function parseTextFile()
    {
        $data = file($this->inputTextFile);

        $timeZoneMap = array();

        foreach ($data as $line) {
            // Remove \n
            $line = str_replace(array("\n", "\r"), '', $line);
            $line = trim($line);

            if (strlen($line) == 0 || substr($line, 0, 1) == '#') {
                continue;
            }
            if (strpos($line, '|')) {
                // Valid line
                $parts = explode('|', $line);


                $prefix = $parts[0];
                $timezone = $parts[1];

                $timeZoneMap[$prefix] = $timezone;
            }
        }

        return $timeZoneMap;
    }
624982
public function getExpiresInterval()
    {
        if (!$this->expiresAt) return '';
        $now = new \DateTime();
        $interval = $now->diff($this->expiresAt);
        if ($interval->days == 1)
            return $interval->format('%a jour');
        elseif ($interval->days > 1)
            return $interval->format('%a jours');
        elseif ($interval->h == 1)
            return $interval->format('%h heure');
        else
            return $interval->format('%h heures');
    }
973783
public function toString() {
		$txt = $this->getId ();
		$data = $this->getDataRaportu ();
		if ($data instanceof \DateTime) {
			$txt .= $this->getDataRaportu ()->format ( "Y-m-d" );
		} else {
			$txt .= $this->getDataRaportu ();
		}
		return $txt;
	}
76439
public function format()
    {
        if ($this->groupEvent) {
            // ugly fix for misunderstanding of this...
            $this->version = 2;
        }

        $result = [
            'Url' => $this->url,
            'EventType' => $this->eventType,
            'IsBackup'  => $this->isBackup,
            'Status'    => $this->status,
            'Version'   => $this->version
        ];

        if($this->apikeyId){
            $result['APIKeyID'] = $this->apikeyId;
        }

        return $result;
    }
129602
public function getFormattedDateRangeDate() {

    // Load session instance date range date values.
    $timestamp = $this->get('timestamp')->value;
    $year_start = date('Y', $timestamp);
    $month_day_start = date('M j', $timestamp);
    $timestamp_to = $this->get('timestamp_to')->value;
    $year_to = date('Y', $timestamp_to);
    $month_day_to = date('M j', $timestamp_to);

    // Format date range to eliminate repeated values.
    if ($year_start == $year_to) {
      if (date('M', $timestamp) == date('M', $timestamp_to)) {
        if ($month_day_start == $month_day_to) {
          // M j, Y.
          $formatted_date = "$month_day_start, $year_start";
        }
        else {
          // M j - j, Y.
          $day_to = date('j', $timestamp_to);
          $formatted_date =  "$month_day_start - $day_to, $year_start";
        }
      }
      else {
        // M j - M j, Y.
        $formatted_date =  "$month_day_start - $month_day_to, $year_start";
      }
    }
    else {
      // M j, Y - M j, Y.
      $formatted_date = $month_day_start . ", $year_start - " . $month_day_to . ", $year_to";
    }

    return $formatted_date;
  }
211013
protected function getFormat()
    {
        if ($this->input->hasOption('format') && $this->input->getOption('format')) {
            return strtolower($this->input->getOption('format'));
        }

        return null;
    }
1208116
public function completed_at_formatted()
    {
        return ucfirst($this->dates->make($this->wrappedObject->completed_at)->format($this->incidentDateFormat()));
    }
314550
public function toFormattedString()
    {
        switch (self::$format) {
            case 'full':
                return number_format($this->num, 0, ',', '.') . '-' . $this->vd;
            case 'basic':
                return $this->num.'-'.$this->vd;
            case 'raw':
            default:
                return $this->num.$this->vd;
        }
    }