IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
5482 | 5482 | } |
5483 | 5483 | |
5484 | 5484 | /** |
5485 | | * Parses and formats a MySQL datetime (Y-m-d H:i:s) for ISO8601/RFC3339. |
| 5485 | * Parses and formats a MySQL datetime (Y-m-d H:i:s) for ISO8601 ('Y-m-d\TH:i:s'). |
5486 | 5486 | * |
5487 | 5487 | * Explicitly strips timezones, as datetimes are not saved with any timezone |
5488 | 5488 | * information. Including any information on the offset could be misleading. |
5489 | 5489 | * |
| 5490 | * Despite historical function name output does not conform to RFC3339 format, |
| 5491 | * which must contain time zone. |
| 5492 | * |
5490 | 5493 | * @since 4.4.0 |
5491 | 5494 | * |
5492 | 5495 | * @param string $date_string Date string to parse and format. |
5493 | | * @return string Date formatted for ISO8601/RFC3339. |
| 5496 | * @return string Date formatted for ISO8601 without time zone. |
5494 | 5497 | */ |
5495 | 5498 | function mysql_to_rfc3339( $date_string ) { |
5496 | | $formatted = mysql2date( 'c', $date_string, false ); |
5497 | 5499 | |
5498 | | // Strip timezone information |
5499 | | return preg_replace( '/(?:Z|[+-]\d{2}(?::\d{2})?)$/', '', $formatted ); |
| 5500 | return mysql2date( 'Y-m-d\TH:i:s', $date_string, false ); |
5500 | 5501 | } |
5501 | 5502 | |
5502 | 5503 | /** |