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
--
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
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
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,
Click BACK to continue.;
exit;
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
I am having a date time comparison issue.
I have statically set the values here. But the data is fed from the database,
CaldTime is timestamp and since it will not allow me to have 2 timestamps in
the same table I set the CallEnd varchar(12). Storing the data they seem to be
the same for
On Mon, Apr 7, 2008 at 9:42 AM, [EMAIL PROTECTED] wrote:
I am having a date time comparison issue.
I have statically set the values here. But the data is fed from the
database, CaldTime is timestamp and since it will not allow me to have 2
timestamps in the same table I set the CallEnd
On Mon, Apr 7, 2008 at 11:42 AM, [EMAIL PROTECTED] wrote:
t the data is fed from the database, CaldTime is timestamp and since
it will not allow me to have 2 timestamps in
the same table
?? What database are you using? It sounds like it has a specific
meaning of timestamp - probably the last
Yes my mistake was looking at another record and published another.
But I figured it out now i can publish 1:45 like i wanted. Having a moment
there.
Thank you
Richard L. Buskirk
On Mon, Apr 7, 2008 at 9:42 AM, [EMAIL PROTECTED] wrote:
I am having a date time comparison issue.
I have
Thank you that is exactly what i did to figure it out.
Just was having a brain fart there for a minute.
On Mon, Apr 7, 2008 at 11:42 AM, [EMAIL PROTECTED] wrote:
t the data is fed from the database, CaldTime is timestamp and since
it will not allow me to have 2 timestamps in
the same table
On Mon, Apr 7, 2008 at 11:42 AM, [EMAIL PROTECTED] wrote:
I am having a date time comparison issue.
I have statically set the values here. But the data is fed from the
database, CaldTime is timestamp and since it will not allow me to have 2
timestamps in the same table I set the CallEnd
Dan I made a solution as below.
$time1 = strtotime($sqldata[CaldTime]);
$time2 = strtotime($sqldata[CallEnd]);
$interval = $time2 - $time1;
$TLength = date(i:s, strtotime(2008-01-01 01:00:$interval));
Result 01:45
Works perfect for me. Do you agree or disagree dan?
On Mon, Apr 7, 2008 at
On Mon, Apr 7, 2008 at 1:03 PM, [EMAIL PROTECTED] wrote:
Dan I made a solution as below.
$time1 = strtotime($sqldata[CaldTime]);
$time2 = strtotime($sqldata[CallEnd]);
$interval = $time2 - $time1;
$TLength = date(i:s, strtotime(2008-01-01 01:00:$interval));
Result 01:45
Works
Hi
I want to substract $first_date to $second_date and print the result
this way :
xx days, xx hours, xx minutes
i tried (strtotime($second_date)-strtotime($first_date)) but what i get
is a timestamp
and i dont know what to do with it
Is there already a function to print the result in a human
BEOI 7308 wrote:
Hi
I want to substract $first_date to $second_date and print the result
this way :
xx days, xx hours, xx minutes
i tried (strtotime($second_date)-strtotime($first_date)) but what i
get is a timestamp and i dont know what to do with it
Is there already a function
Transmit Report:
To: [EMAIL PROTECTED], 402 Local User Inbox Full ([EMAIL PROTECTED])
---BeginMessage---
BEOI 7308 wrote:
Hi
I want to substract $first_date to $second_date and print the result
this way :
xx days, xx hours, xx minutes
i tried
Hello ppl,
Well, I want to compate date is php, could anybody tell me which is the best
way to do so? I have tried various ways but nothing seems consistent.
I tried for example:
if(2003-1-15 2003-1-11)
{
echo true;
}
which doesn't work in some cases...
Thank you!
Best Regards,
Dhaval
- Original Message -
From: Dhaval Desai [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, January 11, 2003 8:38 AM
Subject: [PHP] Date Comparison
Well, I want to compate date is php, could anybody tell me which is the
best way to do so?
Look at PHPs date functions http
On Saturday 11 January 2003 21:38, Dhaval Desai wrote:
Hello ppl,
Well, I want to compate date is php, could anybody tell me which is the
best way to do so? I have tried various ways but nothing seems consistent.
I tried for example:
if(2003-1-15 2003-1-11)
{
echo true;
}
which
hi to all again,
I have a problem here again regarding the date comparison. I need to check the most
recent date that was entered in mysql database in date format (Y-m-d), if the
datetoday is a day or two days in advanced compared to the queried date.
I need to make sure that the next
I have a problem here again regarding the date comparison. I need to
check the most recent date that was entered in mysql database in date
format (Y-m-d), if the datetoday is a day or two days in advanced
compared to the queried date.
I need to make sure that the next inserted date in the
Is it too late to change the way you insert dates into the DB? I really
think the unix timestamp is the easiest way to store dates... comparisons
are easy, because everything is in seconds, and using date() gives you the
ability to re-format your dates over and over again for presentation
On Wed, 8 May 2002, Scott St. John wrote:
Sorry to be so thick this morning, but I have a unix time stamp in my MS
Sql server that is the date, plus 60 days to expire a password. I want to
take today's date and compare to the two to see:
1)How many days until the password expires
2)If the
Thank you Miguel! I was missing the /86400 and it works much better now
:)
On Thu, 9 May 2002, Miguel Cruz wrote:
On Wed, 8 May 2002, Scott St. John wrote:
Sorry to be so thick this morning, but I have a unix time stamp in my MS
Sql server that is the date, plus 60 days to expire a
I have a date string, let's call it 'date a' in the format 2020-10-16
which I want to compare to the UNIX_TIMESTAMP overflow limit (2038-01-18).
Obviously I can't convert date 'a' to a timestamp because it may be too
large. How can I make this comparision without converting it to a timestamp?
]
Subject: [PHP] date comparison
I have a date string, let's call it 'date a' in the format 2020-10-16
which I want to compare to the UNIX_TIMESTAMP overflow limit (2038-01-18).
Obviously I can't convert date 'a' to a timestamp because it may be too
large. How can I make this comparision without
In my experience, it's best to keep everything is unix time stamp format --
soo easy for comparisons, and the function to convert it out to
-MM-DD took me 45 seconds :)
Justin French
on 30/04/02 6:29 AM, Richard Fox ([EMAIL PROTECTED]) wrote:
I have a date string, let's call it 'date
I'd like to compare today's date against a stored date, and then fire
some code based on the result.
Like.
if ($today's_date stored_date+5 days)
then {blah}
Can somebody clue this newbie in on how to do this?
-Bob
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Are you retrieving the stored date from a mySQL database? If so, you can
let mysql SELECT only those records that fit the tardy date criteria.
-Original Message-
From: ROBERT MCPEAK [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 01, 2002 2:22 PM
To: [EMAIL PROTECTED]
Subject: [PHP] date
I'm fairly new to php and still learning it's nuances, etc.
I've created a site - http://www.more-mtb.org - in which I have used several
php resources from around the net and some which I have created my self. On
the home page of the site I have inserted some code that displays a series
of
Greeting all,
Just now I asked about to tie string values together and would like to thank
Jason for that. Anyway one more thing, after I have tied string values
together and assigned that to a virables. can I used the value from that
variables to compare with another date value? Say another date
can I used the value from that variables to compare with another
date value? Say another date value I will use is also retrieved
from a field in table which is in Date data type as well.
When you get into this stuff, it all starts getting a lot more complicated.
If you want to compare two
ubject: RE: [PHP] date comparison
can I used the value from that variables to compare with another
date value? Say another date value I will use is also retrieved
from a field in table which is in Date data type as well.
When you get into this stuff, it all starts getting a lot more
c
Hi people,
may be I did not make my question clear about what I try to do. Basically if I have 2
date values in the same format like -mm-dd, can I use both values to find out if
one come before another and then display message or something? Say I have $date1 =
20010115 and $date2 =
may be I did not make my question clear about what I try to
do. Basically if I have 2 date values in the same format like
-mm-dd, can I use both values to find out if one come
before another and then display message or something? Say I
have $date1 = 20010115 and $date2 = 20010120 (
53 matches
Mail list logo