日期要改成 1001219~1001225 這樣要改那裡呢 ?
$y=date('Y' ,mktime (0,0,0,date("m"), date("d")-7, date("Y")))-1911;
$y=sprintf("%03d",$y);
$y1=date('Y' ,mktime (0,0,0,date("m"), date("d")-1, date("Y")))-1911;
$y1=sprintf("%03d",$y1);
$date_s= $y.date('md' ,mktime (0,0,0,date("m"), date("d")-7, date("Y")));
$date_e= $y1.date('md' ,mktime (0,0,0,date("m"), date("d")-1, date("Y")));
西元改民國嗎?
當天日期直接改
$nowDate = (date("Y") - 1911).date("md");
指定日期
$monthAndDay = mktime(0,0,0,$month,$day,$year - 1911);
$date = ($year - 1911).date("md",$monthAndDay);
$year、$month、$day 分別代表指定的 年、月、日
所以如果要把 20111219 改成 1001219,就直接把年月日代入就好了
$monthAndDay = mktime(0,0,0,12,19,2011-1911);
$date = (2011 - 1911).date("md",$monthAndDay);