BP_REST_Activity_Controller::prepare_date_response PHP Method

prepare_date_response() protected method

Convert the input date to RFC3339 format.
protected prepare_date_response ( string $date_gmt, string | null $date = null ) : string | null
$date_gmt string
$date string | null Optional. Date object.
return string | null ISO8601/RFC3339 formatted datetime.
    protected function prepare_date_response($date_gmt, $date = null)
    {
        if (isset($date)) {
            return mysql_to_rfc3339($date);
        }
        if ($date_gmt === '0000-00-00 00:00:00') {
            return null;
        }
        return mysql_to_rfc3339($date_gmt);
    }