Submission::format_datetime( string $format, bool $gmt = true )

Formats the submission date and time.

Description

See also

Parameters

$format

(string) (Required) Datetime format string. Will be localized.

$gmt

(bool) (Optional) Whether to return as GMT.

Default value: true

Return

(string) Formatted date and time.

Source

File: src/db-objects/submissions/submission.php

	public function format_datetime( $format, $gmt = true ) {
		$timestamp = $this->timestamp;
		if ( ! $gmt ) {
			$timestamp = strtotime( get_date_from_gmt( date( 'Y-m-d H:i:s', $timestamp ) ) );
		}

		return date_i18n( $format, $timestamp );
	}

Changelog

Changelog
Version Description
1.0.0 Introduced.