It's a nice shortcut Jim. Never considered that.
Thanks.
On 20 November 2012 21:03, Jim Lucas 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",
>> strtotime($showsRe
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");
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 wrote:
> Try this:
>
> $todaydate = strtotime(date("D, M jS, Y g:i:s a"));
> $showenddate = strtotime(date("D, M jS, Y g
On Tue, Nov 13, 2012 at 5:11 AM, Kanishka 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 represent about 580 bil
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 wrote:
> Try this:
>
> $todaydate = strtotime(date("D, M jS, Y g:i:s a"));
> $showenddate = strtotime(date("D, M jS, Y
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 conve
"Terry Ally (Gmail)" 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 ($todayda
On 11 Nov 2012, at 19:24, "Terry Ally (Gmail)" 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
--
Stuart Dallas
3ft9 L
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 wrote:
> Please include the list when replying.
>
> On 11 Nov 2012, at 19:08, "Terry Ally (Gmail)"
> wrote:
>
> > What I want is the reverse.
> >
> > I wa
Please include the list when replying.
On 11 Nov 2012, at 19:08, "Terry Ally (Gmail)" 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
> conditional st
On 11 Nov 2012, at 19:00, "Terry Ally (Gmail)" 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 thing.
>
> I
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 18:48
On 11 Nov 2012, at 18:30, "Terry Ally (Gmail)" 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 string.
> if
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) wrote:
> Hi all,
>
> I am having a problem with comparing time. I am using the following:
>
> $todaydate = date("D, M jS,
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
On Thu, Sep 03, 2009 at 10:20:49AM +0100, Stuart wrote:
> 2009/9/3 J DeBord :
> > 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
2009/9/3 J DeBord :
> 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
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
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
om: Stuart [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 :
> How to I ensure a variable date is not in the past, compared to the
> current date? Here's how I
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 p
2009/8/28 David Stoltz :
> 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
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;
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
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, 200
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 CallE
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
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 st
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
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 v
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 output
Transmit Report:
To: [EMAIL PROTECTED], 402 Local User Inbox Full ([EMAIL PROTECTED])
--- Begin Message ---
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)-strtot
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
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 r
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";
>
>- 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
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,
Dhava
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
purposes
> 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
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 insert
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 expi
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
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
ECTED]>
> Date: Mon, 29 Apr 2002 16:29:14 -0400
> To: [EMAIL PROTECTED]
> 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-
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?
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'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: ht
> The display works great until I get to the end of the month (like now). I
> have separated the date as three rows in my dB (msg_year, msg_month and
> msg_day)
Don't do that. :-^
> As soon as the next month starts, then I get 4 events.
>
> I know exactly what's wrong, But my non-programmer limi
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 events
PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Sunday, January 14, 2001 11:37 PM
> Subject: 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
&
The way you want to do this is with UNIX timestamps. FYI a timestamp is the
number of seconds starting at 1970 and going up (it's important to remember
that date - since some people were born before, etc.)
So you need to do this:
$dateA = '12-25-1999';
$dateB = '12-24-1999';
// conve
> 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
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 = 20010120
;
Sent: Sunday, January 14, 2001 11:37 PM
Subject: 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.
>
&g
> 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 tw
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
56 matches
Mail list logo