wpseek.com
WordPress开发者和主题制作者的搜索引擎



wp_exif_date2ts › WordPress Function

Since2.5.0
已弃用n/a
wp_exif_date2ts ( $str )
参数:
  • (string) $str A date string expected to be in Exif format (Y:m:d H:i:s).
    Required: Yes
返回:
  • (int|false) The unix timestamp, or false on failure.
定义在:
文档:

Converts the exif date format to a unix timestamp.



源码

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

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