How to set the “first day of the week” to Thursday in PHP

后端 未结 2 1190

I want to set the first day of the week to Thursday (not Sunday or Monday), because it\'s the company\'s cut-off date.

I already have a code to determine the current wee

2条回答
  •  情歌与酒
    2021-02-20 04:25

    This should work.

    function findweek($date, $type = "l") {
        $time = strtotime($date);
        return date($type, mktime(0, 0, 0, date("m", $time) , date("d", $time)-date("d", $time)+1, date("Y", $time)));
    }
    
    echo findweek('2015-09-16');
    

提交回复
热议问题