> -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
> 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);
> >
> > 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
>
>
> 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
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??
>
> //
>
$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
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 <
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
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
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
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
> 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
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');
>
> -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',
14 matches
Mail list logo