Changeset 34846
- Timestamp:
- 10/06/2015 03:18:45 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r34828 r34846 681 681 * 682 682 * Using an associative array: 683 * 683 * 684 684 * add_query_arg( array( 685 685 * 'key1' => 'value1', 686 686 * 'key2' => 'value2', 687 687 * ), 'http://example.com' ); 688 * 688 * 689 689 * Omitting the URL from either use results in the current URL being used 690 690 * (the value of `$_SERVER['REQUEST_URI']`). 691 * 691 * 692 692 * Values are expected to be encoded appropriately with urlencode() or rawurlencode(). 693 693 * … … 5023 5023 <?php 5024 5024 } 5025 5026 /** 5027 * Parses and formats a MySQL datetime (Y-m-d H:i:s) for ISO8601/RFC3339. 5028 * 5029 * Explicitly strips timezones, as datetimes are not saved with any timezone 5030 * information. Including any information on the offset could be misleading. 5031 * 5032 * @since 4.4.0 5033 * 5034 * @param string $date_string Date string to parse and format. 5035 * @return string Date formatted for ISO8601/RFC3339. 5036 */ 5037 function mysql_to_rfc3339( $date_string ) { 5038 $formatted = mysql2date( 'c', $date_string, false ); 5039 5040 // Strip timezone information 5041 return preg_replace( '/(?:Z|[+-]\d{2}(?::\d{2})?)$/', '', $formatted ); 5042 }
Note: See TracChangeset
for help on using the changeset viewer.