php 实间戳

php得到实践戳
$today=getdate();
$year=$today['year'];
$mon=$today['mon'];
$mday=$today['mday'];
$wday=$today['wday'];
/****本日*****/
$d_day=mktime(0,0,0,$mon,$mday,$year);
/****本周*****/
$d_week=mktime(0,0,0,$mon,$mday-$wday,$year);
/****本月*****/
$d_month=mktime(0,0,0,$mon,1,$year);

echo $year.'-'.$mon.'-'.$mday;
echo '<br/>本日'.$d_day;
echo '<br/>本周'.$d_week;
echo '<br/>本月'.$d_month;
print_r($today);

你可能感兴趣的:(PHP)