RE: [PHP] date, "first of next month"?

2003-02-27 Thread Jon Haworth
Hi Bryan, > > $t = mktime(0,0,0,date('m')+1,1,date('Y')); > > > > Gives you timestamp of first day, next month. > > Format accordingly with date(). > > is there such a say to now get the date of the first > weekday after that date? You can brute force it: // grab the timestamp $t = mktime(0,0,

Re: [PHP] date, "first of next month"?

2003-02-26 Thread Bryan Koschmann - GKT
On Wed, 26 Feb 2003, 1LT John W. Holmes wrote: |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(). Thats great, worked perfectly!

Re: [PHP] date, "first of next month"?

2003-02-26 Thread Brent Baisley
Use the mktime function: mktime (0,0,0,(date("n",$date)+1),1,date("Y",$date)) Where the variable $date contains whatever is the starting date. The function handles a December date just fine also. On Wednesday, February 26, 2003, at 03:28 PM, Bryan Koschmann - GKT wrote: Hello, Does anyone know

Re: [PHP] date, "first of next month"?

2003-02-26 Thread Chris Shiflett
--- Bryan Koschmann - GKT <[EMAIL PROTECTED]> wrote: > 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. Well, you need: 1. The day of the month, which is always going

Re: [PHP] date, "first of next month"?

2003-02-26 Thread 1LT John W. Holmes
> 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')+