首页 > Web开发 > 详细

php获取格式时间和时间戳

时间:2014-08-27 12:35:17      阅读:298      评论:0      收藏:0      [点我收藏+]
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获取格式时间和时间戳

php获取格式时间和时间戳

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!