On this page
wp_exif_date2ts( string $str ): int|false
Converts the exif date format to a unix timestamp.
Parameters
$strstring Required-
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.
Source
File: wp-admin/includes/image.php. View all references
function wp_exif_date2ts( $str ) {
list( $date, $time ) = explode( ' ', trim( $str ) );
list( $y, $m, $d ) = explode( ':', $date );
return strtotime( "{$y}-{$m}-{$d} {$time}" );
}
Related
Used By
| Used By | Description |
|---|---|
| wp_read_image_metadata() wp-admin/includes/image.php | Gets extended image metadata, exif or iptc as available. |
Changelog
| Version | Description |
|---|---|
| 2.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_exif_date2ts