RE: [PHP] Date +30 comparison

2009-09-02 Thread tedd
At 4:06 PM +0100 9/2/09, Ford, Mike wrote: > -Original Message- From: tedd [mailto:tedd.sperl...@gmail.com] Sent: 01 September 2009 21:52 At 2:47 PM -0400 9/1/09, Andrew Ballard wrote: >On Tue, Sep 1, 2009 at 1:27 PM, tedd wrote: >> First get the date to seconds, like so: >> >

RE: [PHP] Date +30 comparison

2009-09-02 Thread Ford, Mike
> -Original Message- > From: tedd [mailto:tedd.sperl...@gmail.com] > Sent: 01 September 2009 21:52 > > At 2:47 PM -0400 9/1/09, Andrew Ballard wrote: > >On Tue, Sep 1, 2009 at 1:27 PM, tedd > wrote: > >> First get the date to seconds, like so: > >> > >> $today_date = '8/26/2009'; > >> >

Re: [PHP] Date +30 comparison

2009-09-01 Thread tedd
At 2:47 PM -0400 9/1/09, Andrew Ballard wrote: On Tue, Sep 1, 2009 at 1:27 PM, tedd wrote: First get the date to seconds, like so: $today_date = '8/26/2009'; $next_date = strtotime($today_date) + (86400 * 30); No. Due to Daylight Saving Time, many time zones have two days each year when

Re: [PHP] Date +30 comparison

2009-09-01 Thread Paul M Foster
On Tue, Sep 01, 2009 at 02:47:43PM -0400, Andrew Ballard wrote: > On Tue, Sep 1, 2009 at 1:27 PM, tedd wrote: > > First get the date to seconds, like so: > > > > $today_date = '8/26/2009'; > > > > $next_date = strtotime($today_date) + (86400 * 30); > > > > No. Due to Daylight Saving Time, many ti

Re: [PHP] Date +30 comparison

2009-09-01 Thread Andrew Ballard
On Tue, Sep 1, 2009 at 1:27 PM, tedd wrote: > First get the date to seconds, like so: > > $today_date = '8/26/2009'; > > $next_date = strtotime($today_date) + (86400 * 30); > No. Due to Daylight Saving Time, many time zones have two days each year when the number of seconds in a day is not 86400.

RE: [PHP] Date +30 comparison

2009-09-01 Thread tedd
At 1:28 PM -0400 9/1/09, David Stoltz wrote: Ok, this is how I finally managed to get it to work - I'm sure there are other ways, but this works: //Check to make sure the next eval date is more than 30 days away $d1 = date('Y-m-d', strtotime($todays_date . '+30 day')); $d2 = date('Y-m-d', strto

RE: [PHP] Date +30 comparison

2009-09-01 Thread David Stoltz
vid Stoltz Cc: php-general@lists.php.net Subject: Re: [PHP] Date +30 comparison On Tue, 2009-09-01 at 12:19 -0400, David Stoltz wrote: > I'm really struggling with dates in PHP. (Yes, I tried reading the > manual)... > > Can someone provide code that does this: > > Takes c

Re: [PHP] Date +30 comparison

2009-09-01 Thread tedd
At 5:43 PM +0100 9/1/09, Ashley Sheridan wrote: On Tue, 2009-09-01 at 12:19 -0400, David Stoltz wrote: I'm really struggling with dates in PHP. (Yes, I tried reading the manual)... Can someone provide code that does this: Takes current date, assigns it to a variable (let's say $today) The

Re: [PHP] Date +30 comparison

2009-09-01 Thread kranthi
i prefer http://in3.php.net/strtotime it supports loads of other formats as well (including +30 days and 8/26/2009) above all it returns unix time stamp which can be used directly with date(). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Date +30 comparison

2009-09-01 Thread Dan Shirah
> > I'm really struggling with dates in PHP. (Yes, I tried reading the > manual)... > > Can someone provide code that does this: > > Takes current date, assigns it to a variable (let's say $today) > Then adds 30 days to $today variable > Takes a string ($nexteval) like '8/26/2009' and compare it to

Re: [PHP] Date +30 comparison

2009-09-01 Thread Ashley Sheridan
On Tue, 2009-09-01 at 12:19 -0400, David Stoltz wrote: > I'm really struggling with dates in PHP. (Yes, I tried reading the > manual)... > > Can someone provide code that does this: > > Takes current date, assigns it to a variable (let's say $today) > Then adds 30 days to $today variable > Takes