On 10/6/2013 11:21 PM, Romain CIACCAFAVA wrote:
An easier way to do that would be using the diff() method of a DateTime object
on another.
Regards
Romain Ciaccafava
Romain - you were so right. A little less calculating to be done and I
got the result I wished. For anyone interested here's
You should use gmdate() if you want to how many hours left to expire
$time_left = gmdate(H:i:s,$diff);
Best Regards
Farzan Dalaee
On Oct 7, 2013, at 1:49, Jim Giner jim.gi...@albanyhandball.com wrote:
I always hate dealing with date/time stuff in php - never get it even close
until an
On 10/6/2013 6:36 PM, Farzan Dalaee wrote:
You should use gmdate() if you want to how many hours left to expire
$time_left = gmdate(H:i:s,$diff);
Best Regards
Farzan Dalaee
On Oct 7, 2013, at 1:49, Jim Giner jim.gi...@albanyhandball.com wrote:
I always hate dealing with date/time stuff in
Try this please
gmdate(H:i:s, $diff%86400)
Best Regards
Farzan Dalaee
On Oct 7, 2013, at 2:12, Jim Giner jim.gi...@albanyhandball.com wrote:
On 10/6/2013 6:36 PM, Farzan Dalaee wrote:
You should use gmdate() if you want to how many hours left to expire
$time_left = gmdate(H:i:s,$diff);
On 10/6/2013 6:49 PM, Farzan Dalaee wrote:
Try this please
gmdate(H:i:s, $diff%86400)
Best Regards
Farzan Dalaee
On Oct 7, 2013, at 2:12, Jim Giner jim.gi...@albanyhandball.com wrote:
On 10/6/2013 6:36 PM, Farzan Dalaee wrote:
You should use gmdate() if you want to how many hours left
Its so freaky
Best Regards
Farzan Dalaee
On Oct 7, 2013, at 2:29, Jim Giner jim.gi...@albanyhandball.com wrote:
On 10/6/2013 6:49 PM, Farzan Dalaee wrote:
Try this please
gmdate(H:i:s, $diff%86400)
Best Regards
Farzan Dalaee
On Oct 7, 2013, at 2:12, Jim Giner
This should help you out
http://stackoverflow.com/questions/365191/how-to-get-time-difference-in-minutes-in-php
On Oct 6, 2013 6:07 PM, Farzan Dalaee farzan.dal...@gmail.com wrote:
Its so freaky
Best Regards
Farzan Dalaee
On Oct 7, 2013, at 2:29, Jim Giner jim.gi...@albanyhandball.com
Jim,
The date method takes in a timestamp (not seconds away).
You have the seconds, you will need to manually convert those seconds to
what you desire (minutes = seconds / 60), (hours = minutes / 60), etc..
Aziz
On Sun, Oct 6, 2013 at 7:07 PM, Farzan Dalaee farzan.dal...@gmail.comwrote:
Its
Look at my code. The inputs are all timestamps so date should work, no?
My question why am i getting an hour value in this case?
jg
On Oct 6, 2013, at 7:14 PM, Aziz Saleh azizsa...@gmail.com wrote:
Jim,
The date method takes in a timestamp (not seconds away).
You have the seconds, you
The resulting subtraction is not a valid timestamp, but rather the
difference between the two timestamps in seconds . The resulting diff can
be 1 if the timestamps are 1 seconds apart. The
linkhttp://stackoverflow.com/questions/365191/how-to-get-time-difference-in-minutes-in-phpJonathan
sent out
On Sun, 2013-10-06 at 19:14 -0400, Aziz Saleh wrote:
Jim,
The date method takes in a timestamp (not seconds away).
You have the seconds, you will need to manually convert those seconds to
what you desire (minutes = seconds / 60), (hours = minutes / 60), etc..
Aziz
On Sun, Oct 6,
On 10/6/2013 7:40 PM, Aziz Saleh wrote:
The resulting subtraction is not a valid timestamp, but rather the
difference between the two timestamps in seconds . The resulting diff can
be 1 if the timestamps are 1 seconds apart. The
On 10/6/2013 7:55 PM, Ashley Sheridan wrote:
On Sun, 2013-10-06 at 19:14 -0400, Aziz Saleh wrote:
Jim,
The date method takes in a timestamp (not seconds away).
You have the seconds, you will need to manually convert those seconds to
what you desire (minutes = seconds / 60), (hours = minutes
An easier way to do that would be using the diff() method of a DateTime object
on another.
Regards
Romain Ciaccafava
Le 7 oct. 2013 à 03:10, Jim Giner jim.gi...@albanyhandball.com a écrit :
On 10/6/2013 7:55 PM, Ashley Sheridan wrote:
On Sun, 2013-10-06 at 19:14 -0400, Aziz Saleh wrote:
On Thu, Mar 28, 2013 at 3:40 PM, Larry Martell larry.mart...@gmail.com wrote:
On Thu, Mar 28, 2013 at 2:44 PM, Steven Staples sstap...@mnsi.net wrote:
I think I am losing my mind. I have some time zone converting code, and I
just don't understand what I am seeing. Also my system seems to return
I think I am losing my mind. I have some time zone converting code, and I
just don't understand what I am seeing. Also my system seems to return the
wrong time after I do some date operations on unrelated objects.
This is from a machine that is in eastern time. I want to convert to, for
On Thu, Mar 28, 2013 at 2:44 PM, Steven Staples sstap...@mnsi.net wrote:
I think I am losing my mind. I have some time zone converting code, and I
just don't understand what I am seeing. Also my system seems to return the
wrong time after I do some date operations on unrelated objects.
This
On 28-3-2013 22:40, Larry Martell wrote:
On Thu, Mar 28, 2013 at 2:44 PM, Steven Staples sstap...@mnsi.net wrote:
I think I am losing my mind. I have some time zone converting code, and I
just don't understand what I am seeing. Also my system seems to return the
wrong time after I do some date
On Thu, Mar 28, 2013 at 4:55 PM, Maciek Sokolewicz
maciek.sokolew...@gmail.com wrote:
On 28-3-2013 22:40, Larry Martell wrote:
On Thu, Mar 28, 2013 at 2:44 PM, Steven Staples sstap...@mnsi.net wrote:
I think I am losing my mind. I have some time zone converting code, and
I
just don't
1/3/2012 is in fact less then 9/16/2012.
On Thu, Jan 3, 2013 at 3:57 PM, Marc Fromm marc.fr...@wwu.edu wrote:
I am comparing to dates.
define('WSOFFBEGIN','09/16/2012');
$jes = 01/03/2012;
if ( date(m/d/Y, strtotime($jes)) date(m/d/Y, strtotime(WSOFFBEGIN))
)
{
$error
Hi.
date returns a string
You should compare a different type for bigger/smaller than
HTH
Kind regards/met vriendelijke groet,
Serge Fonville
http://www.sergefonville.nl
Convince Microsoft!
They need to add TRUNCATE PARTITION in SQL Server
At 04:57 PM 1/3/2013, Marc Fromm wrote:
I am comparing to dates.
define('WSOFFBEGIN','09/16/2012');
$jes = 01/03/2012;
if ( date(m/d/Y, strtotime($jes)) date(m/d/Y, strtotime(WSOFFBEGIN)) )
{
$error = MUST begin after . WSOFFBEGIN . \n;
}
I cannot figure out why the $error
:05 PM
To: Marc Fromm
Cc: php-general@lists.php.net
Subject: Re: [PHP] date problem
Hi.
date returns a string
You should compare a different type for bigger/smaller than
HTH
Kind regards/met vriendelijke groet,
Serge Fonville
http://www.sergefonville.nl
Convince Microsoft!
They need to add
)){
// bla bla
}
Thanks
From: Serge Fonville [mailto:serge.fonvi...@gmail.com]
Sent: Thursday, January 03, 2013 2:05 PM
To: Marc Fromm
Cc: php-general@lists.php.net
Subject: Re: [PHP] date problem
Hi.
date returns a string
You should compare a different type for bigger/smaller
Thanks Jonathan. I removed the date() syntax function and it works.
From: Jonathan Sundquist [mailto:jsundqu...@gmail.com]
Sent: Thursday, January 03, 2013 2:16 PM
To: Marc Fromm
Cc: Serge Fonville; php-general@lists.php.net
Subject: Re: [PHP] date problem
Marc,
When you take a date and do
On 1/3/2013 5:22 PM, Marc Fromm wrote:
Thanks Jonathan. I removed the date() syntax function and it works.
From: Jonathan Sundquist [mailto:jsundqu...@gmail.com]
Sent: Thursday, January 03, 2013 2:16 PM
To: Marc Fromm
Cc: Serge Fonville; php-general@lists.php.net
Subject: Re: [PHP] date problem
On 01/03/2013 01:57 PM, Marc Fromm wrote:
$jes = 01/03/2012;
# php -r echo 01/03/2012;
0.00016567263088138
You might want to put quotes around that value so it is actually a
string and does not get evaluated.
--
Jim Lucas
http://www.cmsws.com/
http://www.cmsws.com/examples/
--
PHP
Dear Duken,
Many thanks for the solution. It worked!
And thanks to everyone else who pitched in with various solutions.
Regards
Terry
On 12 November 2012 10:06, Duken Marga dukenma...@gmail.com wrote:
Try this:
$todaydate = strtotime(date(D, M jS, Y g:i:s a));
$showenddate =
On 11/12/2012 02:06 AM, Duken Marga wrote:
Try this:
$todaydate = strtotime(date(D, M jS, Y g:i:s a));
$showenddate = strtotime(date(D, M jS, Y g:i:s a,
strtotime($showsRecord['end_date'])));
Won't this give you the same results without the extra conversion steps?
$todaydate = date(U);
It's a nice shortcut Jim. Never considered that.
Thanks.
On 20 November 2012 21:03, Jim Lucas li...@cmsws.com wrote:
On 11/12/2012 02:06 AM, Duken Marga wrote:
Try this:
$todaydate = strtotime(date(D, M jS, Y g:i:s a));
$showenddate = strtotime(date(D, M jS, Y g:i:s a,
On Tue, Nov 13, 2012 at 5:11 AM, Kanishka kanishkani...@gmail.com wrote:
if we use a date after 19 January 2038, we can not use 'strtotime' to get
timestamp.
http://en.wikipedia.org/wiki/Year_2038_problem
Only if you're running 32bit OS. If you're running 64bit OS with 64bit PHP
you can
Terry Ally (Gmail) terrya...@gmail.com hat am 11. November 2012 um 19:30
geschrieben:
Hi all,
I am having a problem with comparing time. I am using the following:
$todaydate = date(D, M jS, Y g:i:s a);
$showenddate = date(D, M jS, Y g:i:s a,
strtotime($showsRecord['end_date']));
if
Try this:
$todaydate = strtotime(date(D, M jS, Y g:i:s a));
$showenddate = strtotime(date(D, M jS, Y g:i:s a,
strtotime($showsRecord['end_date'])));
if ($todaydate $showenddate):
echo The date of the show has not yet arrived;
else:
echo The show has ended;
endif;
You must convert both
if we use a date after 19 January 2038, we can not use 'strtotime' to get
timestamp.
http://en.wikipedia.org/wiki/Year_2038_problem
On Mon, Nov 12, 2012 at 3:36 PM, Duken Marga dukenma...@gmail.com wrote:
Try this:
$todaydate = strtotime(date(D, M jS, Y g:i:s a));
$showenddate =
You can always use timestamp which is integer.
$todaydate = time();
$showenddate = strtotime($showsRecord['end_date']);
On Mon, Nov 12, 2012 at 12:30 AM, Terry Ally (Gmail) terrya...@gmail.comwrote:
Hi all,
I am having a problem with comparing time. I am using the following:
$todaydate =
On 11 Nov 2012, at 18:30, Terry Ally (Gmail) terrya...@gmail.com wrote:
I am having a problem with comparing time. I am using the following:
$todaydate = date(D, M jS, Y g:i:s a);
$showenddate = date(D, M jS, Y g:i:s a,
strtotime($showsRecord['end_date']));
The date function returns a
Hi Shiplu and Stuart,
Comparing timestamps was my first option. I've reinstated it. Have a look
at http://www.lakesidesurrey.co.uk/test.php (show_source included) and you
will see that PHP is still outputting the wrong thing.
I just can't figure out what's wrong.
Terry
On 11 November 2012
On 11 Nov 2012, at 19:00, Terry Ally (Gmail) terrya...@gmail.com wrote:
Hi Shiplu and Stuart,
Comparing timestamps was my first option. I've reinstated it. Have a look
at http://www.lakesidesurrey.co.uk/test.php (show_source included) and you
will see that PHP is still outputting the wrong
Please include the list when replying.
On 11 Nov 2012, at 19:08, Terry Ally (Gmail) terrya...@gmail.com wrote:
What I want is the reverse.
I want that if people attempt to access the show page after the show has
ended that it triggers an error which takes it to another page. The actual
Stuart,
I reversed it as you suggested and every future show is displaying as
having ended.
Terry
On 11 November 2012 19:11, Stuart Dallas stu...@3ft9.com wrote:
Please include the list when replying.
On 11 Nov 2012, at 19:08, Terry Ally (Gmail) terrya...@gmail.com
wrote:
What I want is
On 11 Nov 2012, at 19:24, Terry Ally (Gmail) terrya...@gmail.com wrote:
I reversed it as you suggested and every future show is displaying as having
ended.
In that case the code you're showing us is not the code you're running, because
that's the obvious error in test.php.
-Stuart
--
On Thu, Oct 25, 2012 at 3:06 PM, Ron Piggott
ron.pigg...@actsministries.org wrote:
Is it possible for PHP to accept the following as a date:
04:11:22 Aug 21, 2011 PDT
so I may output it as:
gmdate(‘Y-m-d H:i:s’)
- I want the time zone included
Sure.
?php
$ds = strtotime('04:11:22
On 05/02/2012 02:36 PM, Haluk Karamete wrote:
This is my code and the output is right after that...
$PDate = $row['PDate'];
//row is tapping into ms-sql date field.
//and the ms-sql data field has a value like this for the PDate;
//07/12/2001
$PDate = $PDate-date;
echo h1[, $PDate , ]/h1;
echo
Haluk,
After you retrieve the date from the database you still have to convert it
from a string to time and then to a date. Try:
?php echo date(l j M Y, , strtotime($row['PDate'])) ; ?
Terry
On 2 May 2012 22:36, Haluk Karamete halukkaram...@gmail.com wrote:
This is my code and the output is
On Wed, May 2, 2012 at 11:36 PM, Haluk Karamete halukkaram...@gmail.com wrote:
This is my code and the output is right after that...
$PDate = $row['PDate'];
//row is tapping into ms-sql date field.
//and the ms-sql data field has a value like this for the PDate;
//07/12/2001
$PDate =
Nathan Nobbe quickshif...@gmail.com hat am 26. April 2012 um 06:40
geschrieben:
INSERT TIMESTAMP: 1335414561
INSERT DATE TIME: 2012-04-26 4:29:21
But then from the interactive interpreter on the same box (same php.ini
as
well):
php echo date(Y-m-d G:i:s, 1335414561);
2012-04-25
On 26/04/2012, at 4:40 PM, Nathan Nobbe wrote:
Hi everyone,
Does anybody know what might influence the output of the date() function
besides date.timezone setting?
Running through some code in an app I'm working on, I have this code:
$timestamp = time();
$mysqlDatetime = date(Y-m-d
On Wed, Apr 25, 2012 at 10:44 PM, Simon J Welsh si...@welsh.co.nz wrote:
On 26/04/2012, at 4:40 PM, Nathan Nobbe wrote:
Hi everyone,
Does anybody know what might influence the output of the date() function
besides date.timezone setting?
Running through some code in an app I'm
yes,it is set in php.ini .
2012/1/5 Adam Richardson simples...@gmail.com
On Wed, Jan 4, 2012 at 11:07 PM, xucheng helloworldje...@gmail.comwrote:
hi all,
I have a webapp which track visitors, and use xhprof for profiling my
codes .
After reading some reports produced by xhprof, i found
On Wed, Jan 4, 2012 at 11:07 PM, xucheng helloworldje...@gmail.com wrote:
hi all,
I have a webapp which track visitors, and use xhprof for profiling my
codes .
After reading some reports produced by xhprof, i found that function
Date() kills most time of my app !
how can this happen ?
Just try of March. Worked for me.
print first: .date(d-m-Y H:i:s,strtotime('first Tuesday of March
2011')).\n;
print second: .date(d-m-Y H:i:s,strtotime('second Tuesday of March
2011')).\n;
print third: .date(d-m-Y H:i:s,strtotime('third Tuesday of March
2011')).\n;
print fourth: .date(d-m-Y
It seems different php versions have different outputs for this code:
Fedora Core 14 (x86):
first: 01-03-2011 00:00:00
second: 08-03-2011 00:00:00
third: 22-03-2011 00:00:00
fourth: 22-03-2011 00:00:00
fifth: 29-03-2011 00:00:00
Fedora Core11 (x86_64):
first: 31-12-1969 16:00:00
second:
I removed the day (1 before the March), but its still giving the same
result, i.e. different days of month with and without the 'first'. Any
further help ?
print first Tuesday :.date(d-m-Y H:i:s,strtotime('March 2011
Tuesday')).\n;
print first: .date(d-m-Y H:i:s,strtotime('March 2011 first
On Wed, 2010-07-07 at 13:28 -0700, Don Wieland wrote:
Hello all,
I am processing an array to build an INSERT string in PHP. The code
below I build an a separate array for the TARGET fields and the VALUES.
I am trying to trap for a NULL ENTRY in a Date Input Field. Date
fields are
On Jul 8, 2010, at 10:09 AM, Ashley Sheridan wrote:
thanks Ash,
I figure it out. I was not entering the full year.
date('y-m-d',strtotime($fval))
needed to be
date('o-m-d',strtotime($fval))
Duh ;-)
Thanks,
Don
On Wed, 2010-07-07 at 13:28 -0700, Don Wieland wrote:
Hello all,
I am
; a...@ashleysheridan.co.uk;
php-general@lists.php.net
Subject: Re: [PHP] Date Conversion Problem
David,
I think it would help people like me (newbie) to know the exact
statements. Though I could envisage what you would have done with my
current learning, it would be good if I double check the statements that
went
On Thu, 2010-06-17 at 08:35 -0400, David Stoltz wrote:
PHP newbie here...
I have some PHP code writing the date/time into a MS SQL 2000 database
like this:
date('l jS \of F Y h:i:s A')
So the text it writes into the DB is like: Thursday 15th of April 2010
10:13:42 AM
I would agree with you, but I have no control on inherited web apps.
I now need to concentrate on trying to fix this.
From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk]
Sent: Thursday, June 17, 2010 8:38 AM
To: David Stoltz
Cc: php-general@lists.php.net
Subject: Re: [PHP] Date
On 17 June 2010 13:35, David Stoltz dsto...@shh.org wrote:
PHP newbie here...
I have some PHP code writing the date/time into a MS SQL 2000 database
like this:
date('l jS \of F Y h:i:s A')
So the text it writes into the DB is like: Thursday 15th of April 2010
10:13:42 AM
The
On 17 June 2010 13:40, Richard Quadling rquadl...@gmail.com wrote:
On 17 June 2010 13:35, David Stoltz dsto...@shh.org wrote:
PHP newbie here...
I have some PHP code writing the date/time into a MS SQL 2000 database
like this:
date('l jS \of F Y h:i:s A')
So the text it writes into
Stoltz
Cc: php-general@lists.php.net
Subject: Re: [PHP] Date Conversion Problem
On Thu, 2010-06-17 at 08:35 -0400, David Stoltz wrote:
PHP newbie here...
I have some PHP code writing the date/time into a MS SQL 2000 database
like this:
date('l jS \of F Y h:i:s A')
So the text
...not to mention I'm a
newbie, so that doesn't help ;-)
Thanks!
-Original Message-
From: Richard Quadling [mailto:rquadl...@gmail.com]
Sent: Thursday, June 17, 2010 8:47 AM
To: David Stoltz
Cc: a...@ashleysheridan.co.uk; php-general@lists.php.net
Subject: Re: [PHP] Date Conversion Problem
On 17
To: David Stoltz
Cc: a...@ashleysheridan.co.uk; php-general@lists.php.net
Subject: Re: [PHP] Date Conversion Problem
On 17 June 2010 13:40, David Stoltz dsto...@shh.org wrote:
I would agree with you, but I have no control on inherited web apps.
I now need to concentrate on trying to fix
: Thursday, June 17, 2010 8:47 AM
To: David Stoltz
Cc: a...@ashleysheridan.co.uk; php-general@lists.php.net
Subject: Re: [PHP] Date Conversion Problem
On 17 June 2010 13:40, David Stoltz dsto...@shh.org wrote:
I would agree with you, but I have no control on inherited web apps.
I now need
On 20 April 2010 17:40, Floyd Resler fres...@adex-intl.com wrote:
I need to get the difference in months between two dates. The dates could
be as much as 60 months apart. Is there any easy way to do this either
through PHP or MySQL? I know how I can do it through code but thought there
On Apr 21, 2010, at 5:39 AM, Michiel Sikma wrote:
On 20 April 2010 17:40, Floyd Resler fres...@adex-intl.com wrote:
I need to get the difference in months between two dates. The dates could
be as much as 60 months apart. Is there any easy way to do this either
through PHP or MySQL? I
On Tue, Apr 20, 2010 at 11:40 AM, Floyd Resler fres...@adex-intl.comwrote:
I need to get the difference in months between two dates. The dates could
be as much as 60 months apart. Is there any easy way to do this either
through PHP or MySQL? I know how I can do it through code but thought
At 11:40 AM -0400 4/20/10, Floyd Resler wrote:
I need to get the difference in months between two dates. The dates
could be as much as 60 months apart. Is there any easy way to do
this either through PHP or MySQL? I know how I can do it through
code but thought there might be a simple one
On Tue, Apr 20, 2010 at 03:32:58PM -0400, tedd wrote:
At 11:40 AM -0400 4/20/10, Floyd Resler wrote:
I need to get the difference in months between two dates. The dates
could be as much as 60 months apart. Is there any easy way to do
this either through PHP or MySQL? I know how I can do it
Telling someone RTFM is just rude and mean. Manipulating dates and times can
be confusing for beginners and experienced people alike. I would suggest
that when a question asked here causes you to respond with RTFM, don't
respond at all. Save yourself the time and trouble and save the person
asking
2009/9/3 J DeBord jasdeb...@gmail.com:
Telling someone RTFM is just rude and mean. Manipulating dates and times can
be confusing for beginners and experienced people alike. I would suggest
that when a question asked here causes you to respond with RTFM, don't
respond at all. Save yourself the
On Thu, Sep 03, 2009 at 10:20:49AM +0100, Stuart wrote:
2009/9/3 J DeBord jasdeb...@gmail.com:
Telling someone RTFM is just rude and mean. Manipulating dates and times can
be confusing for beginners and experienced people alike. I would suggest
that when a question asked here causes you to
At 10:01 AM +0200 9/3/09, J DeBord wrote:
Telling someone RTFM is just rude and mean.
And not taking the time to research your question before posting is
what, thoughtful and kind?
The phrase RTFM is something I don't like to tell people, and from
what I remember, I have never said that to
-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, teddtedd.sperl...@gmail.com
wrote:
First get the date to seconds, like so:
$today_date = '8/26/2009';
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, teddtedd.sperl...@gmail.com
wrote:
First get the date to
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 a
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 $today.
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
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)
: 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 current date, assigns it to a variable (let's say $today)
Then adds 30 days
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',
On Tue, Sep 1, 2009 at 1:27 PM, teddtedd.sperl...@gmail.com 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
On Tue, Sep 01, 2009 at 02:47:43PM -0400, Andrew Ballard wrote:
On Tue, Sep 1, 2009 at 1:27 PM, teddtedd.sperl...@gmail.com 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
At 2:47 PM -0400 9/1/09, Andrew Ballard wrote:
On Tue, Sep 1, 2009 at 1:27 PM, teddtedd.sperl...@gmail.com 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
At 1:01 PM -0400 8/28/09, David Stoltz wrote:
Hey Stuart -
RTFM yourselfI did read it, and obviously misunderstood...
I'm really sorry to bother you. I thought that was what a listserv
like this was for - to ask questions...
I'll try not to ask questions I should know the answer to next
2009/8/28 David Stoltz dsto...@shh.org:
How to I ensure a variable date is not in the past, compared to the
current date? Here's how I'm trying, unsuccessfully:
$nextdate = 8/2/2009;
if(strtotime($nextdate)=getdate()){
echo Sorry, your next evaluation date cannot be in the past,
At 10:12 AM -0400 8/28/09, David Stoltz wrote:
How to I ensure a variable date is not in the past, compared to the
current date? Here's how I'm trying, unsuccessfully:
$nextdate = 8/2/2009;
if(strtotime($nextdate)=getdate()){
echo Sorry, your next evaluation date cannot be in the
[mailto:stut...@gmail.com]
Sent: Friday, August 28, 2009 10:19 AM
To: David Stoltz
Cc: php-general@lists.php.net
Subject: Re: [PHP] Date Comparison
2009/8/28 David Stoltz dsto...@shh.org:
How to I ensure a variable date is not in the past, compared to the
current date? Here's how I'm trying
On Tue, Apr 28, 2009 at 3:45 PM, Andrew Williams
andrew4willi...@gmail.comwrote:
hi all,
$dateNow = date('Y-m-d H:i:s');
echo pstrong.$dateNow ./strong/p;
can some see why the date time is lagging or late by 30 minutes from the
server time even when server time are correct
--
Best
Ron Piggott wrote:
Where $date_reference is 2009-04-18 the following code gives me a day of
1969-12-30. How do I get it to be 2009-04-17?
$previous_date = strtotime(-1 days, $date_reference);
$previous_date = date('Y-m-d', $previous_date);
Slightly wrong syntax.
$previous_date =
Ron Piggott wrote:
Where $date_reference is 2009-04-18 the following code gives me a day of
1969-12-30. How do I get it to be 2009-04-17?
$previous_date = strtotime(-1 days, $date_reference);
$previous_date = date('Y-m-d', $previous_date);
echo $previous_date; outputs 1969-12-30
Ron
Thanks Chris. It has been a while since I used this command. Ron
On Mon, 2009-04-20 at 13:27 +1000, Chris wrote:
Ron Piggott wrote:
Where $date_reference is 2009-04-18 the following code gives me a day of
1969-12-30. How do I get it to be 2009-04-17?
$previous_date = strtotime(-1
-general@lists.php.net
Subject: Re: [PHP] Date Issue
Boyd, Todd M. wrote:
Are you sure this isn't like Javascript's getMonth function? Its
index may begin at 0, making day 0 the first day of the year.
Hmm, though I know us programmers love to start counting at zero, why
would
, 2008 4:50 PM
To: Boyd, Todd M.
Cc: [EMAIL PROTECTED]; php-general@lists.php.net
Subject: Re: [PHP] Date Issue
Boyd, Todd M. wrote:
Are you sure this isn't like Javascript's getMonth function? Its
index may begin at 0, making day 0 the first day of the year.
Hmm, though
On Tue, Nov 18, 2008 at 2:58 PM, Ashley Sheridan
[EMAIL PROTECTED] wrote:
It just flew in the face of all I knew at the time to have a
non-associative system-generated array (by that I mean one whos keys are
integars and not string keys) that doesn't start at 0. No other arrays
defined in
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2008 10:50 AM
To: php-general@lists.php.net
Subject: [PHP] Date Issue
$smont = 10;
$sday = 13;
$syear = 2008;
$timestamp = mktime(0,0,0,$smont,$sday,$syear);
$thismonth =
Boyd, Todd M. wrote:
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2008 10:50 AM
To: php-general@lists.php.net
Subject: [PHP] Date Issue
$smont = 10;
$sday = 13;
$syear = 2008;
$timestamp = mktime(0,0,0,$smont,$sday,$syear);
$thismonth =
Boyd, Todd M. wrote:
Are you sure this isn't like Javascript's getMonth function? Its index may begin at 0, making
day 0 the first day of the year.
HTH,
Todd Boyd
Web Programmer
Hmm, though I know us programmers love to start counting at zero, why
would something as static as a date
-Original Message-
From: Craige Leeder [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2008 4:50 PM
To: Boyd, Todd M.
Cc: [EMAIL PROTECTED]; php-general@lists.php.net
Subject: Re: [PHP] Date Issue
Boyd, Todd M. wrote:
Are you sure this isn't like Javascript's getMonth
On Mon, 2008-11-17 at 16:57 -0600, Boyd, Todd M. wrote:
-Original Message-
From: Craige Leeder [mailto:[EMAIL PROTECTED]
Sent: Monday, November 17, 2008 4:50 PM
To: Boyd, Todd M.
Cc: [EMAIL PROTECTED]; php-general@lists.php.net
Subject: Re: [PHP] Date Issue
Boyd, Todd M
1 - 100 of 718 matches
Mail list logo