Subtracting a certain number of hours, days, months or years from date

后端 未结 3 1666
Happy的楠姐
Happy的楠姐 2020-12-03 05:49

I\'m trying to create a simple function which returns me a date with a certain number of subtracted days from now, so something like this but I dont know the date classes we

3条回答
  •  生来不讨喜
    2020-12-03 06:25

    something like this:

    function offset hours($hours) {
        return strtotime("+$hours hours");
    }
    

提交回复
热议问题