wp_exif_date2ts

The timeline below displays how wordpress function wp_exif_date2ts has changed across different WordPress versions. If a version is not listed, refer to the next available version below.

WordPress Version: 6.1

/**
 * Converts the exif date format to a unix timestamp.
 *
 * @since 2.5.0
 *
 * @param string $str A date string expected to be in Exif format (Y:m:d H:i:s).
 * @return int|false The unix timestamp, or false on failure.
 */
function wp_exif_date2ts($str)
{
    list($date, $time) = explode(' ', trim($str));
    list($y, $m, $d) = explode(':', $date);
    return strtotime("{$y}-{$m}-{$d} {$time}");
}

WordPress Version: 5.9

/**
 * Convert the exif date format to a unix timestamp.
 *
 * @since 2.5.0
 *
 * @param string $str A date string expected to be in Exif format (Y:m:d H:i:s).
 * @return int|false The unix timestamp, or false on failure.
 */
function wp_exif_date2ts($str)
{
    list($date, $time) = explode(' ', trim($str));
    list($y, $m, $d) = explode(':', $date);
    return strtotime("{$y}-{$m}-{$d} {$time}");
}

WordPress Version: 5.3

/**
 * Convert the exif date format to a unix timestamp.
 *
 * @since 2.5.0
 *
 * @param string $str
 * @return int
 */
function wp_exif_date2ts($str)
{
    list($date, $time) = explode(' ', trim($str));
    list($y, $m, $d) = explode(':', $date);
    return strtotime("{$y}-{$m}-{$d} {$time}");
}

WordPress Version: 3.7

/**
 * Convert the exif date format to a unix timestamp.
 *
 * @since 2.5.0
 *
 * @param string $str
 * @return int
 */
function wp_exif_date2ts($str)
{
    @list($date, $time) = explode(' ', trim($str));
    @list($y, $m, $d) = explode(':', $date);
    return strtotime("{$y}-{$m}-{$d} {$time}");
}