RE: [PHP] Problem with date

2011-12-07 Thread admin
> -Original Message- > From: Jack [mailto:jacklistm...@gmail.com] > Sent: Wednesday, December 07, 2011 1:49 PM > To: PHP > Subject: [PHP] Problem with date > > Hello All, > > > > I have a problem where Dates are coming out as 12.31.1969 19:00:00 > which of > course we didn't have PC's

RE: [PHP] Problem with date

2011-12-07 Thread Jack
> To: PHP > Subject: RE: [PHP] Problem with date > > > > > > > How about a little debugging here (and possibly elsewhere): > > > > if (isset($pubdate) && ($pubdate >0)) { > > $pubdate=strtotime($pubdate); > >

RE: [PHP] Problem with date

2011-12-07 Thread Jack
> > How about a little debugging here (and possibly elsewhere): > > > > if (isset($pubdate) && ($pubdate >0)) { > > $pubdate=strtotime($pubdate); > > } else { > > die("Barf. Can't run a string to time conversion on 0 or -1."); > > } > > > Thanks Kevin, T

RE: [PHP] Problem with date

2011-12-07 Thread Jack Sasportas
> > > How about a little debugging here (and possibly elsewhere): > > if (isset($pubdate) && ($pubdate >0)) { > $pubdate=strtotime($pubdate); > } else { > die("Barf. Can't run a string to time conversion on 0 or -1."); > } > Thanks Kevin, This bombs

Re: [PHP] Problem with date

2011-12-07 Thread Jim Lucas
On 12/7/2011 10:48 AM, Jack wrote: > Hello All, > > I have a problem where Dates are coming out as 12.31.1969 19:00:00 which of > course we didn't have PC's in 1969 > > I'm not able to see where the date is getting screwed up, any ideas?? > > // >

Re: [PHP] Problem with date

2011-12-07 Thread Joshua Kehn
$pubdate is probably null or something. Regards, –Josh Joshua Kehn | @joshkehn http://joshuakehn.com On Dec 7, 2011, at 1:48 PM, Jack wrote: > Hello All, > > > > I have a problem where Dates are coming out as 12.31.1969 19:00:00 which of > course we didn

Re: [PHP] Problem with DATE 2010-10-31

2010-10-12 Thread Richard Quadling
On 12 October 2010 10:52, Rado Oršula wrote: > I do not know good English. > In the attached source code. > Here is erroneous statement: > > date: 2010-10-31 00:00:00 > date+0h: 2010-10-31 00:00:00 > date+1h: 2010-10-31 01:00:00 > date+2h: 2010-10-31 02:00:00  <<< > date+3h: 2010-10-31 02:00:00  <

Re: [PHP] Problem with DATE 2010-10-31

2010-10-12 Thread richard gray
On 12/10/2010 11:52, Rado Oršula wrote: I do not know good English. In the attached source code. Here is erroneous statement: date: 2010-10-31 00:00:00 date+*0*h: 2010-10-31 *00*:00:00 date+*1*h: 2010-10-31 *01*:00:00 *date+2h: 2010-10-31 02:00:00 <<< date+3h: 2010-10-31 02:00:00 <<<* date+*4*h

RE: [PHP] Problem with date

2009-09-15 Thread Mayer, Jonathan
strtotime would be a neater way of solving the problem... ie (untested): $n = 0; while ($n <= 9) { $date = "d".$n; $$date = date("Y-m-d", strtotime("+ $n days") $n++; } If you are just enquiring about the maths though, I'm not sure! -Original Message- From: Korga

Re: [PHP] Problem with date

2009-09-15 Thread Jonathan Tapicer
Adding the number of seconds in a day could fall in the same day due to daylight saving time, a more reliable way of adding one day (or a given number of days) is this: $tomorrow = mktime(0, 0, 0, date("m") , date("d")+1, date("Y")); Then use date() with $tomorrow to format it. (Taken from exa

Re: [PHP] Problem with date('w')

2003-08-26 Thread BEOI 7308
i found out that using strtotime did the trick !! > > I have a problem with the date function > > > > > $theday = date("Y-m-d", time()); > > echo date((w), $theday); > > ?> > > I'm pretty sure the optional second argument for date is a unix timestamp > that you would generate by using either

RE: [PHP] Problem with date('w')

2003-08-25 Thread Jennifer Goodie
> I have a problem with the date function > > $theday = date("Y-m-d", time()); > echo date((w), $theday); > ?> I'm pretty sure the optional second argument for date is a unix timestamp that you would generate by using either time or mktime or strtotime. You are passing it something in the for

Re: [PHP] Problem with Date (2003-03-30)

2003-01-29 Thread Dale Schell
All parameters whould be integers. Unquote them and use intval to strip the leading zeros. On 1/29/03 11:51, "Gareth Mulholland" <[EMAIL PROTECTED]> wrote: > I'm having problems with mktime and Midnight on 30th March 2003. > > The code I'm using is: > > echo mktime(0,0,1,'03','29','2003'); >

RE: [PHP] Problem with Date (2003-03-30)

2003-01-29 Thread Johnson, Kirk
> -Original Message- > From: Gareth Mulholland [mailto:[EMAIL PROTECTED]] > > I'm having problems with mktime and Midnight on 30th March 2003. > > The code I'm using is: > > echo mktime(0,0,1,'03','29','2003'); > echo mktime(0,0,1,'03','30','2003'); > echo mktime(0,0,1,'03',