format_datetime() public method

Format a unix timestamp or MySQL datetime into an RFC3339 datetime
Since: 2.1
public format_datetime ( integer | string $timestamp, boolean $convert_to_utc = false, boolean $convert_to_gmt = false ) : string
$timestamp integer | string unix timestamp or MySQL datetime
$convert_to_utc boolean
$convert_to_gmt boolean Use GMT timezone.
return string RFC3339 datetime
 /**
  * Get formatted birthdate.
  *
  * @param  string        $date
  * @param  WC_API_Server $server
  *
  * @return string
  */
 protected function get_formatted_birthdate($date, $server)
 {
     $birthdate = explode('/', $date);
     if (isset($birthdate[1]) && !empty($birthdate[1])) {
         return $server->format_datetime($birthdate[1] . '/' . $birthdate[0] . '/' . $birthdate[2]);
     }
     return '';
 }