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

Convert the input date to RFC3339 format.

Description

Parameters

$date_gmt

(Required) Date GMT format.

$date

(Optional) Date object.

Default value: null

Return

(string|null) ISO8601/RFC3339 formatted datetime.

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 );
}

Changelog

Changelog
Version Description
BuddyBoss 1.3.5 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.