Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2003022

Re: [PHP] date, "first of next month"? From: 1LT John W. Holmes (holmes072000 <email protected>)
Date: 02/26/03

> Does anyone know a way to do this easily? I have a script that pretty much
> says "this is due on the first of next month" but I would like it to
> actually use the correct date.

You would think strtotime("first of next month") would work, but it doesn't.
This does:

$t = mktime(0,0,0,date('m')+1,1,date('Y'));

Gives you timestamp of first day, next month. Format accordingly with
date().

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php