Un motore di ricerca WordPress per sviluppatori e autori di temi



mysql_to_rfc3339 ›

Da4.4.0
Deprecaton/a
mysql_to_rfc3339 ( $date_string )
Parametri:
  • (string) $date_string Date string to parse and format.
    Richiesto:
Ritorna:
  • (string) Date formatted for ISO8601 without time zone.
Definito a:
Codex:

Parses and formats a MySQL datetime (Y-m-d H:i:s) for ISO8601 (Y-m-d\TH:i:s).

Explicitly strips timezones, as datetimes are not saved with any timezone information. Including any information on the offset could be misleading.

Despite historical function name, the output does not conform to RFC3339 format, which must contain timezone.



Funzioni correlate:

Sorgenti

function mysql_to_rfc3339( $date_string ) {
	return mysql2date( 'Y-m-d\TH:i:s', $date_string, false );
}