mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Date/Time: Simplify mysql_to_rfc3339().
Erasing timezone with a regular expression is redundant, the date could be just formatted in the respective format instead. Props Rarst. Fixes #42542. git-svn-id: https://develop.svn.wordpress.org/trunk@43384 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -5863,10 +5863,7 @@ function wp_post_preview_js() {
|
||||
* @return string Date formatted for ISO8601 without time zone.
|
||||
*/
|
||||
function mysql_to_rfc3339( $date_string ) {
|
||||
$formatted = mysql2date( 'c', $date_string, false );
|
||||
|
||||
// Strip timezone information
|
||||
return preg_replace( '/(?:Z|[+-]\d{2}(?::\d{2})?)$/', '', $formatted );
|
||||
return mysql2date( 'Y-m-d\TH:i:s', $date_string, false );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user