//年月日转 unixtime时间戳(PHP代码函数)
//代码来源:Monxin ./config/functions.php
function get_unixtime($date,$date_style) {
if($date_style[0]=='m'){
$temp=explode($date_style[1],$date);
$temp2=explode($date_style[1],$date);
$temp[0]=$temp2[1];
$temp[1]=$temp2[0];
$date=implode($date_style[1],$temp);
}
$r=strtotime($date);
if($r!=false){return $r;}
try{$datetime= new DateTime($date);return $datetime->format('U');}catch(Exception $e){return 0;}
}
年月日转 unixtime时间戳(PHP代码函数)
最新推荐文章于 2023-03-13 08:15:00 发布