Get the previous month timestamp.

@return int The previous month timestamp.
517897
protected function get_previous_month_data() {
        $type = $this->related['type'];
        $date = $type->timestamp_to_date_array($this->calendar->time);
        list($date['mon'], $date['year']) = $type->get_prev_month($date['year'], $date['mon']);
        $time = $type->convert_to_timestamp($date['year'], $date['mon'], 1);

        return $type->timestamp_to_date_array($time);
    }
590729
public function getTimestamp()
	{
		if (!isset($this->timestamp))
		{
			$this->timestamp = $this->hasAdapterOrFail()->adapter->getTimestamp($this->getPath());
		}

		return $this->timestamp;
	}
223572
static function prevMonth($key = null) {
        $prev = self::todayIfNull(date('Y') . '-' . date('M') . '-01') - 24 * 3600;
        $ret  = [
            'y' => (int)date('Y', $prev),
            'm' => (int)date('m', $prev),
        ];
        return $key ? Arr::get($ret, $key) : $ret;
    }
43566
public function lastUpdatedDate() {
    $directory = $this->environment->getHooksDirectory();
    $hooks_file = "$directory/hooks_processed.php";
    if (file_exists($hooks_file)) {
      $timestamp = filemtime($hooks_file);
      return $timestamp;
    }
  }
288936
private static function getMonths(): array
    {
        $months = [-1 => static::getConstant('TXT_DATETIME_MMM', 'TXT_DATETIME_MMM')];
        for ($i = 1; $i <= 12; $i++) {
            $months[$i] = static::getConstant('TXT_DATETIME_MONTH_'.$i.'_SHORT', 'TXT_DATETIME_MONTH_'.$i.'_SHORT');
        }
        return $months;
    }
1236541
public function lastChangeTimestamp(): Carbon
    {
        /** @var Fact|null $chan */
        $chan = $this->facts(['CHAN'])->first();

        if ($chan instanceof Fact) {
            // The record does have a CHAN event
            $d = $chan->date()->minimumDate();

            if (preg_match('/\n3 TIME (\d\d):(\d\d):(\d\d)/', $chan->gedcom(), $match)) {
                return Carbon::create($d->year(), $d->month(), $d->day(), (int) $match[1], (int) $match[2], (int) $match[3]);
            }

            if (preg_match('/\n3 TIME (\d\d):(\d\d)/', $chan->gedcom(), $match)) {
                return Carbon::create($d->year(), $d->month(), $d->day(), (int) $match[1], (int) $match[2]);
            }

            return Carbon::create($d->year(), $d->month(), $d->day());
        }

        // The record does not have a CHAN event
        return Carbon::createFromTimestamp(0);
    }
244524
public function getLastMoveIndex()
    {
        $move_history = $this->getMoveHistory();

        // get last value
        $last_move = end($move_history);

        // reset pointer
        reset($this->moves);

        return $last_move;
    }
941040
private function getCronTimestamp()
    {
        /* @var $version string e.g. "2.1.7" */
        $version = $this->productMetadata->getVersion();
        if (version_compare($version, '2.2.0') >= 0) {
            return $this->dateTime->gmtTimestamp();
        }
        return $this->timezone->scopeTimeStamp();
    }
531818
protected function getDefaultDates()
    {
        $dates = array(
            'today'      => $this->translator->translate('Intl_Today'),
            'yesterday'  => $this->translator->translate('Intl_Yesterday'),
            'previous7'  => $this->translator->translate('General_PreviousDays', 7),
            'previous30' => $this->translator->translate('General_PreviousDays', 30),
            'last7'      => $this->translator->translate('General_LastDays', 7),
            'last30'     => $this->translator->translate('General_LastDays', 30),
            'week'       => $this->translator->translate('General_CurrentWeek'),
            'month'      => $this->translator->translate('General_CurrentMonth'),
            'year'       => $this->translator->translate('General_CurrentYear'),
        );

        $mappingDatesToPeriods = array(
            'today' => 'day',
            'yesterday' => 'day',
            'previous7' => 'range',
            'previous30' => 'range',
            'last7' => 'range',
            'last30' => 'range',
            'week' => 'week',
            'month' => 'month',
            'year' => 'year',
        );

        // assertion
        if (count($dates) != count($mappingDatesToPeriods)) {
            throw new Exception("some metadata is missing in getDefaultDates()");
        }

        $allowedPeriods = self::getEnabledPeriodsInUI();
        $allowedDates = array_intersect($mappingDatesToPeriods, $allowedPeriods);
        $dates = array_intersect_key($dates, $allowedDates);

        /**
         * Triggered when the list of available dates is requested, for example for the
         * User Settings > Report date to load by default.
         *
         * @param array &$dates Array of (date => translation)
         */
        Piwik::postEvent('UsersManager.getDefaultDates', array(&$dates));

        return $dates;
    }
278356
protected function createdTimestamp() {

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

		if ( $timestamp ) {

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

		return $timestamp;
	}
804484
public function getMonth($timestamp = false)
    {
        if (!$timestamp) {
            $timestamp = $this->dateTime->getTimestamp();
        }

        return date('n', $timestamp);
    }
212769
public function getDeletedAtTimestamp(): ?int
    {
        if (!$this->isDeleted()) {
            return null;
        }

	    $timestamp = strtotime($this->getDeletedAt() . 'UTC');

	    if ($timestamp === false) {
		    throw new Exception("Unable to get timestamp from \"{$this->getDeletedAt()}\"");
	    }

	    return $timestamp;
    }
455633
protected function get_previous_day_data() {
        $type = $this->related['type'];
        $time = $type->get_prev_day($this->calendar->time);

        return $type->timestamp_to_date_array($time);
    }
367904
public function getMonths() {
        $months = array();
        for ($i = 1; $i <= 12; $i++) {
            if ($i < 10)
                $months[$i] = '0' . $i;
            else
                $months[$i] = $i;
        }
        return $months;
    }
241026
public function getLastRefreshTimestamp()
    {
        $unixTime = Cache::get($this->cacheTimestampKey);
        
        $dateTime = new DateTime;
        $dateTime->setTimestamp($unixTime);
        
        return $dateTime;
    }
732342
public function getCreatedAtTimestamp(): ?int
    {
        if (!$this->hasCreatedAt()) {
            return null;
        }

	    $timestamp = strtotime($this->getCreatedAt() . 'UTC');

	    if ($timestamp === false) {
		    throw new Exception("Unable to get timestamp from \"{$this->getCreatedAt()}\"");
	    }

	    return $timestamp;
    }
1125566
public function getDefaultMonth()
    {
        $result = null;

        $keys = array_keys($this->getMonths());
        if (count($keys) >= 2) {
            $result = (string)$keys[1];
        }

        return $result;
    }