wp_exif_date2ts() – Convert the exif date format to a unix timestamp.

You appear to be a bot. Output may be restricted

Description

Convert the exif date format to a unix timestamp.

Usage

$int|false = wp_exif_date2ts( $str );

Parameters

$str
( string ) required – A date string expected to be in Exif format (Y:m:d H:i:s).

Returns

int|false The unix timestamp, or false on failure.

Source

File name: wordpress/wp-admin/includes/image.php
Lines:

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

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

 View on GitHub View on Trac