mysql2date() WP 1.0
Convert given date string into a different format.
$format should be a PHP date format string. 'U' and 'G' formats will return a sum of timestamp with timezone offset. $date is expected to be local time in MySQL format (Y-m-d H:i:s).
Historically UTC time could be passed to the function to produce Unix timestamp.
If $translate is true then the given date and format string will be passed to wp_date() for translation.
Works based on: wp_date()
1 time — 0.00018 sec (fast) | 50000 times — 4.42 sec (fast)
No Hooks.
Return
String|Int|false. Formatted date string or sum of Unix timestamp and timezone offset. False on failure.
Usage
mysql2date( $format, $date, $translate );
- $format(string) (required)
- Format of the date to return.
- $date(string) (required)
- Date string to convert.
- $translate(true/false)
- Whether the return date should be translated.
Default: true
Changelog
Since 0.71 | Introduced. |