PHP获取一天起始时间戳,结束时间戳

来源:互联网 发布:java工程师岗位管理 编辑:程序博客网 时间:2024/06/06 03:41
<?php$t=time();//获取当前时间戳echo date("Y-m-d h:i:s",$t)."<br />";$start=mktime(0,0,0,date("m",$t),date("d",$t),date("Y",$t));$end=mktime(23,59,59,date("m",$t),date("d",$t),date("Y",$t));echo $start.":".date("Y-m-d h:i:s",$start)."<br />";echo $end.":".date("Y-m-d h:i:s",$end)."<br />";


就是这么简单。

PS:不要被$start的格式化输出骗了,虽然显示的是20xx-xx-xx  12:00:00

但其实是00:00:00来着,可以$start减一再格式化输出试试。

0 0