php 月初,月末时间

$timestamp = strtotime( '2018-2' );
$start_time = date( 'Y-m-1 00:00:00', $timestamp );
$mdays = date( 't', $timestamp );
$end_time = date( 'Y-m-' . $mdays . ' 23:59:59', $timestamp );
echo $start_time;
echo $end_time;

posted on 2019-03-21 21:01  running-fly  阅读(1703)  评论(0编辑  收藏  举报

导航