To get the timestamp of the first of the next month, I'm getting the timestamp of the first of this month, using mktime() and date() calls, then add 45 days to get the next month and year, then mktime() again. This seems like a very inefficient way to do it. Just one of those things that won't click,
.... maybe its just cuz its 2:30am....
either way: anyone have a pretty way to do this?
First of next month....
Moderator: General Moderators
Well... If you know what month it is...why don't you just make
Code: Select all
if ($this_month == 12) {
$year++;
}
$next_month_timestamp = mktime(0,0,0,$this_month + 1, 1, $year);- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Code: Select all
[feyd@home]>php -r "echo date('Y-m-d H:i:s', strtotime(date('Y-m-01').' +1 month'));"
2006-08-01 00:00:00