> -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
> w
> 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
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??
//
#
function ShowFe
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
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: 2010-10-31 *03*:00:00
date+5h: 2010-10-
sure!
-Original Message-
From: Korgan [mailto:josber...@seznam.cz]
Sent: 15 September 2009 16:32
To: php-general@lists.php.net
Subject: [PHP] Problem with date
Hi,
I have a problem with date function.
$gen_pos = mktime(0,0,1,10,25,2009);
$d1 = date("Y-m-d", $gen_pos);
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
Hi,
I have a problem with date function.
$gen_pos = mktime(0,0,1,10,25,2009);
$d1 = date("Y-m-d", $gen_pos); // 2009-10-25
$d2 = date("Y-m-d", $gen_pos + (1*24*60*60)); // 2009-10-25
$d3 = date("Y-m-d", $gen_pos + (2*24*60*60)); // 2009-10-26
$d4 = date("Y-m-d", $gen_pos + (3*24*60
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
Hi
I have a problem with the date function
should print 1 if today is monday, 2 if today is tuesday ...
though it's printing 4 and today is monday !
any idea ?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
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',
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','31','2003');
but the result is:
1048896001
-3661
1049065201
Therefore date is giving
19 matches
Mail list logo