creates formatted output for calendar component property dtstamp

@author Kjell-Inge Gustafsson <ical@kigkonsult.se>
@since 2.2.4 - 2007-08-01
@return string
172266
function createDtstamp() {
    if( !isset( $htis->dtstamp['value']['year'] )  &&
        !isset( $this->dtstamp['value']['month'] ) &&
        !isset( $this->dtstamp['value']['day'] )   &&
        !isset( $this->dtstamp['value']['hour'] )  &&
        !isset( $this->dtstamp['value']['min'] )   &&
        !isset( $this->dtstamp['value']['sec'] ))
      $this->_makeDtstamp();
    $formatted  = $this->_format_date_time( $this->dtstamp['value'], 7 );
    $attributes = $this->_createParams( $this->dtstamp['params'] );
    return $this->_createElement( 'DTSTAMP', $attributes, $formatted );
  }
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;
  }
1103769
private function _writeDatemode()
	{
		$record    = 0x0022;         // Record identifier
		$length    = 0x0002;         // Bytes to follow

		$f1904     = (PHPExcel_Shared_Date::getExcelCalendar() == PHPExcel_Shared_Date::CALENDAR_MAC_1904) ?
			1 : 0;   // Flag for 1904 date system

		$header    = pack("vv", $record, $length);
		$data      = pack("v", $f1904);
		$this->_append($header . $data);
	}
278356
protected function createdTimestamp() {

		$timestamp = $this->raw( 'created_timestamp' );

		if ( $timestamp ) {

			$timestamp = date_i18n(
				get_option( 'date_format' ),
				strip_tags( $timestamp )
			);
		}

		return $timestamp;
	}
755742
public function toNailsDate($mTimestamp = null)
    {
        $oConverted = static::convert($mTimestamp, $this->sTimezoneNails, $this->sTimezoneUser);

        if (is_null($oConverted)) {
            return null;
        }

        return $oConverted->format('Y-m-d');
    }
15088
public function created_at_formatted()
    {
        return ucfirst(app(DateFactory::class)->make($this->wrappedObject->created_at)->format($this->incidentDateFormat()));
    }
455626
public function xmlOutput() {
        $o = '';
        $o.= '    <TABLE NAME="' . $this->name . '"';
        if ($this->comment) {
            $o.= ' COMMENT="' . htmlspecialchars($this->comment) . '"';
        }
        $o.= '>' . "\n";
        // Now the fields
        if ($this->fields) {
            $o.= '      <FIELDS>' . "\n";
            foreach ($this->fields as $field) {
                $o.= $field->xmlOutput();
            }
            $o.= '      </FIELDS>' . "\n";
        }
        // Now the keys
        if ($this->keys) {
            $o.= '      <KEYS>' . "\n";
            foreach ($this->keys as $key) {
                $o.= $key->xmlOutput();
            }
            $o.= '      </KEYS>' . "\n";
        }
        // Now the indexes
        if ($this->indexes) {
            $o.= '      <INDEXES>' . "\n";
            foreach ($this->indexes as $index) {
                $o.= $index->xmlOutput();
            }
            $o.= '      </INDEXES>' . "\n";
        }
        $o.= '    </TABLE>' . "\n";

        return $o;
    }
547897
private function getDumpFileHeader()
    {
        $header = '';
        if (!$this->dumpSettings['skip-comments']) {
            // Some info about software, source and time
            $header = "-- mysqldump-php https://github.com/ifsnop/mysqldump-php".PHP_EOL.
                    "--".PHP_EOL.
                    "-- Host: {$this->host}\tDatabase: {$this->dbName}".PHP_EOL.
                    "-- ------------------------------------------------------".PHP_EOL;

            if (!empty($this->version)) {
                $header .= "-- Server version \t".$this->version.PHP_EOL;
            }

            if (!$this->dumpSettings['skip-dump-date']) {
                $header .= "-- Date: ".date('r').PHP_EOL.PHP_EOL;
            }
        }
        return $header;
    }
1333148
private function getFieldOutputTimestamp($dtl, $iar = [])
    {
        if (($dtl['COLUMN_DEFAULT'] == 'CURRENT_TIMESTAMP') || ($dtl['EXTRA'] == 'on update CURRENT_TIMESTAMP')) {
            return $this->getTimestamping($dtl)['input'];
        }
        $input = $this->getFieldOutputTT($dtl, 19, $iar);
        if (!array_key_exists('readonly', $iar)) {
            $input .= $this->setCalendarControlWithTime($dtl['COLUMN_NAME']);
        }
        return $input;
    }
861758
public function getTimestamp()
    {
        $name = $this->name;
        $this->timestamp = $this->resource->getTimestamp($name, $this->sdopx);
        return $this->timestamp;
    }
858089
function createComponent( &$xcaldecl ) {
    $objectname    = $this->_createFormat();
    $component     = $this->componentStart1.$objectname.$this->componentStart2.$this->nl;
    $component    .= $this->createUid();
    $component    .= $this->createDtstamp();
    $component    .= $this->createAttach();
    $component    .= $this->createAttendee();
    $component    .= $this->createCategories();
    $component    .= $this->createClass();
    $component    .= $this->createComment();
    $component    .= $this->createCompleted();
    $component    .= $this->createContact();
    $component    .= $this->createCreated();
    $component    .= $this->createDescription();
    $component    .= $this->createDtstart();
    $component    .= $this->createDue();
    $component    .= $this->createDuration();
    $component    .= $this->createExdate();
    $component    .= $this->createExrule();
    $component    .= $this->createGeo();
    $component    .= $this->createLastModified();
    $component    .= $this->createLocation();
    $component    .= $this->createOrganizer();
    $component    .= $this->createPercentComplete();
    $component    .= $this->createPriority();
    $component    .= $this->createRdate();
    $component    .= $this->createRelatedTo();
    $component    .= $this->createRequestStatus();
    $component    .= $this->createRecurrenceid();
    $component    .= $this->createResources();
    $component    .= $this->createRrule();
    $component    .= $this->createSequence();
    $component    .= $this->createStatus();
    $component    .= $this->createSummary();
    $component    .= $this->createUrl();
    $component    .= $this->createXprop();
    if( $this->nl != substr( $component, ( 0 - strlen( $this->nl ))))
      $component  .= $this->nl;
    $component    .= $this->createSubComponent();
    $component    .= $this->componentEnd1.$objectname.$this->componentEnd2;
    if( is_array( $this->xcaldecl ) && ( 0 < count( $this->xcaldecl ))) {
      foreach( $this->xcaldecl as $localxcaldecl )
        $xcaldecl[] = $localxcaldecl;
    }
    return $component;
  }
581169
public function createFormatter()
    {
        $num = array_push($this->formatters, new PHPCPDFormatterElement($this));

        return $this->formatters[$num - 1];
    }
132390
private function getOutput()
    {
        $output = "# Todo list\n\n";

        // Make menu
        $columns = 12;

        $captions = implode('|', array_fill(0, $columns, ' '));
        $subcaptions = implode('|', array_fill(0, $columns, ':---:'));

        $output .= "|$captions|\n";
        $output .= "|$subcaptions|\n";

        $menu = [];
        foreach (array_keys($this->output) as $language) {
            $menu[] = "[$language](#$language)";
        }

        $rows = array_chunk($menu, $columns);
        array_map(function ($row) use (&$output) {
            $row = implode(' | ', $row);
            $output .= $row."\n";
        }, $rows);

        $output .= "\n\n";

        // Make items
        foreach ($this->output as $language => $values) {
            $output .= "#### {$language}:\n";
            $output .= implode(PHP_EOL, $values);
            $output .= "\n\n[ [to top](#todo-list) ]\n\n";
        }

        return $output;
    }
1229376
function _createFormat() {
    $objectname                   = null;
    switch( $this->format ) {
      case 'xcal':
        $objectname               = ( isset( $this->timezonetype )) ?
                                 strtolower( $this->timezonetype )  :  strtolower( $this->objName );
        $this->componentStart1    = $this->elementStart1 = '<';
        $this->componentStart2    = $this->elementStart2 = '>';
        $this->componentEnd1      = $this->elementEnd1   = '</';
        $this->componentEnd2      = $this->elementEnd2   = '>'.$this->nl;
        $this->intAttrDelimiter   = '<!-- -->';
        $this->attributeDelimiter = $this->nl;
        $this->valueInit          = null;
        break;
      default:
        $objectname               = ( isset( $this->timezonetype )) ?
                                 strtoupper( $this->timezonetype )  :  strtoupper( $this->objName );
        $this->componentStart1    = 'BEGIN:';
        $this->componentStart2    = null;
        $this->componentEnd1      = 'END:';
        $this->componentEnd2      = $this->nl;
        $this->elementStart1      = null;
        $this->elementStart2      = null;
        $this->elementEnd1        = null;
        $this->elementEnd2        = $this->nl;
        $this->intAttrDelimiter   = '<!-- -->';
        $this->attributeDelimiter = ';';
        $this->valueInit          = ':';
        break;
    }
    return $objectname;
  }
630514
public static function getLocalTimestampFromUtcTimestamp( $utcTimestamp ) {
        $utcTimezone = new \DateTimeZone( 'UTC' );
        $localTimezone = new \DateTimeZone( date_default_timezone_get() );

        $utcDate = new \DateTime( null, $utcTimezone );
        $utcDate->setTimestamp( $utcTimestamp );
        $localDate = new \DateTime( $utcDate->format( 'Y-m-d H:i:s' ), $localTimezone );

        return $localDate->getTimestamp();
    }
47998
public function renderCreateColumns()
    {
        $columns = $this->getTableColumns();

        if (!$columns) {
            return '';
        }

        $source = '';

        foreach ($columns as $column) {
            $attributes = [$this->serializeArrayToAttributes($column->getName())];
            $type       = $column->getType()->getName();

            switch ($type) {
                case Type::INTEGER:
                    $method = 'integer';
                    break;
                case Type::SMALLINT:
                    $method = 'smallInteger';
                    break;
                case Type::BIGINT:
                    $method = 'bigInteger';
                    break;
                case Type::STRING:
                    $attributes[] = $column->getLength();
                    $method       = 'string';
                    break;
                case Type::GUID:
                case Type::TEXT:
                    $method = 'text';
                    break;
                case Type::FLOAT:
                    $method = 'float';
                    break;
                case Type::DECIMAL:
                    $attributes[] = $column->getPrecision();
                    $attributes[] = $column->getScale();
                    $method       = 'decimal';
                    break;
                case Type::BOOLEAN:
                    $method = 'boolean';
                    break;
                case Type::DATETIME:
                case Type::DATETIMETZ:
                    $method = 'dateTime';
                    break;
                case Type::DATE:
                    $method = 'date';
                    break;
                case Type::TIME:
                    $method = 'time';
                    break;
                case Type::BINARY:
                case Type::BLOB:
                    $method = 'binary';
                    break;
                case Type::JSON_ARRAY:
                    $method = 'json';
                    break;
                default:
                    throw new DbExporterException('Not supported database column type' . $type);
                    break;
            }

            $source .= '$table->' . $method . '(' . implode(', ', $attributes) . ')';
            if ($column->getUnsigned()) {
                $source .= "\n" . '      ->unsigned()';
            }
            if (!$column->getNotnull()) {
                $source .= "\n" . '      ->nullable()';
            }
            if ($column->getDefault() || $column->getDefault() === null && !$column->getNotnull()) {
                $source .= "\n" . '      ->default(' . var_export($column->getDefault(), true) . ')';
            }
            $source .= ';' . "\n";
        }

        return trim($source);
    }
78905
public function getTableData()
    {
        $items = FeedbackContactUs::selectRaw('*, DATE_FORMAT(created_at, "%d %b, %Y ") as date')
            ->where('created_at', '>=', $this->inputDateFrom() . '%')
            ->where('created_at', '<=', $this->inputDateTo() . '  23:59:59')
            ->orderBy('created_at')
            ->get();

        return DataTables::of($items)->addColumn('fullname', function ($row) {
            return $row->fullname;
        })->addColumn('date', function ($row) {
            return $row->created_at->format('d M Y');
        })->make(true);
    }