$time1 = strtotime(date('Y-m-d 00:00:00',time()));
$time2 = strtotime(date('Y-m-d 23:59:59',time()));
$date1 = date('Y-m-d 00:00:00',time());
$date2 = date('Y-m-d 23:59:59',time());
$time1 = strtotime(date('Y-m-d 00:00:00',time()-3600*24));
$time2 = strtotime(date('Y-m-d 23:59:59',time()-3600*24));
$date1 = date('Y-m-d 00:00:00',time()-3600*24);
$date2 = date('Y-m-d 23:59:59',time()-3600*24);
$time1 = mktime(0,0,0,date('m'),date('d')-date('N')+1,date('y'));
$time2 = mktime(23,59,59,date('m'),date('d')-date('N')+7,date('Y'));
$date1 = date("Y-m-d H:i:s",mktime(0, 0 , 0,date("m"),date("d")-date("N")+1,date("Y")));
$date2 = date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("d")-date("N")+7,date("Y")));
$time1 = mktime(0,0,0,date('m'),date('d')-date('N')-6,date('Y'));
$time2 = mktime(23,59,59,date('m'),date('d')-date('N'),date('Y'));
$date1 = date('Y-m-d H:i:s', mktime(0,0,0, date('m'), date('d')-date('N')-6,date('Y')));
$date2 = date('Y-m-d H:i:s', mktime(23,59,59, date('m'), date('d')-date('N'),date('Y')));
$time1 = mktime(0,0,0,date('m'),1,date('Y'));
$time2 = mktime(23,59,59,date('m'),date('t'),date('Y'));
$date1 = date("Y-m-d H:i:s",mktime(0, 0 , 0,date("m"),1,date("Y")));
$date2 = date("Y-m-d H:i:s",mktime(23,59,59,date("m"),date("t"),date("Y")));
$time1 = strtotime(date('Y-m-01 00:00:00',strtotime('-1 month')));
$time2 = strtotime(date("Y-m-d 23:59:59", strtotime(-date('d').'day')));
$date1 = date("Y-m-d H:i:s",mktime(0, 0 , 0,date("m")-1,1,date("Y")));
$date2 = date("Y-m-d H:i:s",mktime(23,59,59,date("m") ,0,date("Y")));
public function getAllMonth($year)
{
$yeararr = [];
$month = [];
for ($i=1; $i <=12 ; $i++) {
$yeararr[$i] = $year.'-'.$i;
}
foreach ($yeararr as $key => $value) {
$timestamp = strtotime( $value );
$month[] = (int)date( 'Y-m', $timestamp );
}
return $month;
}
public function getNonthDays($start, $end)
{
$dt_start = strtotime($start);
$dt_end = strtotime($end);
while ($dt_start <= $dt_end) {
$value[] = date('m-d', $dt_start);
$dt_start = strtotime('+1 day', $dt_start);
}
return $value;
}
|