wp_exif_date2ts( string $str )

Convert the exif date format to a unix timestamp.

Parameters

$str

(string) (Required)

Return

(int)

Source

File: wp-admin/includes/image.php

function wp_exif_date2ts( $str ) {
	list( $date, $time ) = explode( ' ', trim( $str ) );
	list( $y, $m, $d )   = explode( ':', $date );

	return strtotime( "{$y}-{$m}-{$d} {$time}" );
}

Changelog

Version Description
2.5.0 Introduced.

© 2003–2021 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_exif_date2ts