php获取格式时间和时间戳

时间:2014-08-27 12:35:17   收藏:0   阅读:298
function get_intime($intime,$format){
	if($intime==""){
		return "";
	}
	$format = isset($format)?$format:‘Y-m-d H:i:s‘;
	if(preg_match(‘/\d{10,}/is‘,$intime)){
		return date($format,$intime);;
	}else{
		return date($format,strtotime($intime));;
	}
}
function get_intime_strtotime($time){//获取时间戳
	return strtotime(get_intime($time));
}

  

  php获取格式时间和时间戳

原文:http://www.cnblogs.com/chenzhaojx/p/3938994.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!