wpseek.com
A WordPress-centric search engine for devs and theme authors



wp_exif_date2ts › WordPress Function

Since2.5.0
Deprecatedn/a
wp_exif_date2ts ( $str )
Parameters:
  • (string) $str A date string expected to be in Exif format (Y:m:d H:i:s).
    Required: Yes
Returns:
  • (int|false) The unix timestamp, or false on failure.
Defined at:
Codex:

Converts the exif date format to a unix timestamp.



Source

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

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