mysql2date


mysql2date ( $format, $date, $translate = true )

Parameters:
  • (string) format Format of the date to return.
  • (string) date Date string to convert.
  • (bool) translate Whether the return date should be translated. Default true.
Returns:
  • (string|int|false) Integer if `$format` is 'U' or 'G', string otherwise. False on failure.
Defined at:

Description

Converts given MySQL date string into a different format.- `$format` should be a PHP date format string. - 'U' and 'G' formats will return an integer 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.

Related Functions

is_date, translate

Top Google Results

User discussions

wpseek mobile