回答

收藏

PHP 获取年的第一天 和最后一天

使用技巧 使用技巧 978 人阅读 | 0 人回复 | 2024-09-02

if(empty($commitdate))  {   $commitdate=date("Y-m-d"); }
        $commitdate_month=date('m',strtotime($commitdate));
        $commitdate_year=date('y',strtotime($commitdate));
        $commitdate_day=date('d',strtotime($commitdate));
        $commitdate_week=date('w',strtotime($commitdate));
        $commitdate_t=date('t',strtotime($commitdate));

        //按年
        $startTime  = strtotime(date("Y",strtotime($commitdate))."-1"."-1");
        $overTime  = strtotime(date("Y",strtotime($commitdate))."-12"."-31");  








分享到:
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

57 积分
15 主题
+ 关注