第一种方式 $date= date(Y-m-d,strtotime(2011-12-12)); 第二种方式 $date = 2011-12-12; $year=((int)substr($date,0,4));//取得年份 $month=((int)substr($date,5,2));//取得月份 $day=((int)substr($date,8,2));//取得几号 $_date = date(M-d-Y,mktime(0,
第一种方式
$date= date("Y-m-d",strtotime("2011-12-12"));
第二种方式
$date = "2011-12-12";
$year=((int)substr($date,0,4));//取得年份
$month=((int)substr($date,5,2));//取得月份
$day=((int)substr($date,8,2));//取得几号
$_date = date("M-d-Y",mktime(0,0,0,$month,$day,$year));
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn