bp_rest_prepare_date_response( string $date_gmt, string|null $date = null )

Convert the input date to RFC3339 format.


Parameters Parameters

$date_gmt

(string) (Required) Date GMT format.

$date

(string|null) (Optional) Date object.

Default value: null


Top ↑

Return Return

(string|null) ISO8601/RFC3339 formatted datetime.


Source Source

File: bp-core/bp-core-rest-api.php

function bp_rest_prepare_date_response( $date_gmt, $date = null ) {
	if ( isset( $date ) ) {
		return mysql_to_rfc3339( $date );
	}

	if ( '0000-00-00 00:00:00' === $date_gmt ) {
		return null;
	}

	return mysql_to_rfc3339( $date_gmt );
}


Top ↑

Changelog Changelog

Changelog
Version Description
5.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.