
时间戳
多么不容易
六年级PHP菜鸟
一年级GO菜鸡
展开
-
php根据指定年月份获取月初月末的时间戳
function get_ctime($month){ $month_start =strtotime($month) ;//指定年月份月初时间戳 $BeginDate=date('Y-m-01', strtotime($month)); $EndDate = date('Y-m-d', strtotime("$BeginDate +1 month -1 day")); $month_end= strtotime("next day", str转载 2020-05-27 17:15:04 · 379 阅读 · 0 评论 -
获取今日、昨日、上周、本月、上月、上上月,最近三个月,前三个月 的起始时间戳 结束时间戳,自动跨年计算
<?php //php获取今日开始时间戳和结束时间戳 $beginToday=mktime(0,0,0,date('m'),date('d'),date('Y')); $endToday=mktime(0,0,0,date('m'),date('d')+1,date('Y'))-1; //php获取昨日起始时间戳和结束时间戳 $beginYester...原创 2017-12-27 14:22:47 · 5823 阅读 · 0 评论 -
最近三个月,之前三个月的时间戳。自动跨年计算
//获取要查询的时间段的 开始时间和结束时间 switch ($month) { case 1: #本期时间段 $nowbegin = strtotime(date("Y-m-d H:i:s",mktime(0, 0 , 0,date("m")-1,1,date("Y"))));#上月 $nowend=strtotime(date("Y-m-d H:i:s",mktime(0, 0...原创 2020-05-20 19:58:25 · 2572 阅读 · 0 评论