Hi there,
I'm using mktime(0, 0, 1, $i, 1, $year), and I was wondering how I can find the unix time for 23:59:59 at the last day of the same month ($i).
Thanks.
Getting end of month
Moderator: General Moderators
Re: Getting end of month
You can use date('t') to find number of days. Or you can use the fact that if you pass negative number to mktime, it will go to the previous month correctlyJKM wrote:Hi there,
I'm using mktime(0, 0, 1, $i, 1, $year), and I was wondering how I can find the unix time for 23:59:59 at the last day of the same month ($i).
Thanks.
mktime(23,59,59, $i+1, -1, $year)