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 Gener
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
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 a
23';
> if(strtotime<http://www.php.net/strtotime>($dateA) > strtotime<
> http://www.php.net/strtotime>($dateB)){
> // bla bla
> }
>
> Thanks
>
>
> From: Serge Fonville [mailto:serge.fonvi...@gmail.com]
> Sent: Thursday, January 03, 2013 2:05 PM
onvi...@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 than
HTH
Kind regards/met vriendelijke groet,
Serge Fonville
http://www.serge
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
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
https://connect.microsoft.com/SQLServer/feedback/det
1/3/2012 is in fact less then 9/16/2012.
On Thu, Jan 3, 2013 at 3:57 PM, 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 = " M
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: 31-12-1
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 "fou
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 fir
On Fri, Apr 1, 2011 at 12:35, Dan Dan wrote:
> Hi Folks,
>
> I am trying to get the day of month for a particular day of week (e.g.
> Tuesday) for the first, second, third, fourth week in a month. The code i
> have seems issues in March, but works e.g. in April:
>
> print date("d-m-Y H:i:s",strtot
On Mon, August 13, 2007 12:50 pm, Kevin Murphy wrote:
> Small issue with formatting a date. If I type in this:
>
> echo date("g:i:s a \o\n l F j, Y");
>
> the "n" character in the word "on" doesn't appear, but instead what I
> get is a new line in the source code. If I type it as:
>
> echo date("g:
Kevin Murphy wrote:
Small issue with formatting a date. If I type in this:
echo date("g:i:s a \o\n l F j, Y");
the "n" character in the word "on" doesn't appear, but instead what I
get is a new line in the source code. If I type it as:
echo date("g:i:s a \on l F j, Y");
I get the number 8 (
Hey Richard,
Thanks, you've pulled my butt outa the fire again :-)
Cheers,
Ryan
On 7/6/2005 10:59:36 PM, Richard Lynch ([EMAIL PROTECTED]) wrote:
> On Wed, July 6, 2005 12:07 pm, Ryan A said:
> >
> I'm confused, this should give me the age as 17 instead of 16...but it
> > does
> > not...any idea
Philip Hallstrom wrote:
of leap years between the two dates. Leap years occur every 4 years,
and 17 / 4 = 4.25, so there were 4 leap years between 7/6/88 and
7/6/05 and
Just to nitpick... :-)
http://en.wikipedia.org/wiki/Leap_year
The Gregorian calendar adds an extra day to February, maki
On Jul 6, 2005, at 5:31 PM, Edward Vermillion wrote:
On Jul 6, 2005, at 5:17 PM, Edward Vermillion wrote:
On Jul 6, 2005, at 4:44 PM, Philip Hallstrom wrote:
of leap years between the two dates. Leap years occur every 4
years, and 17 / 4 = 4.25, so there were 4 leap years between 7/6/88
On Jul 6, 2005, at 5:17 PM, Edward Vermillion wrote:
On Jul 6, 2005, at 4:44 PM, Philip Hallstrom wrote:
of leap years between the two dates. Leap years occur every 4
years, and 17 / 4 = 4.25, so there were 4 leap years between 7/6/88
and 7/6/05 and
Just to nitpick... :-)
http://en.wiki
On Jul 6, 2005, at 4:44 PM, Philip Hallstrom wrote:
of leap years between the two dates. Leap years occur every 4 years,
and 17 / 4 = 4.25, so there were 4 leap years between 7/6/88 and
7/6/05 and
Just to nitpick... :-)
http://en.wikipedia.org/wiki/Leap_year
The Gregorian calendar adds an
of leap years between the two dates. Leap years occur every 4 years, and 17
/ 4 = 4.25, so there were 4 leap years between 7/6/88 and 7/6/05 and
Just to nitpick... :-)
http://en.wikipedia.org/wiki/Leap_year
The Gregorian calendar adds an extra day to February, making it 29 days
long, in year
On Jul 6, 2005, at 3:59 PM, Richard Lynch wrote:
365.24 is an appoximation.
Sooner or later, it's gonna bit you in the butt.
If you want somebody's age accurately, you're probably going to have
to do
it the hard way.
Something like this might work:
$age--; //They were born in a late
Ryan A wrote:
Hi,
I'm confused, this should give me the age as 17 instead of 16...but it does
not...any ideas why?
Thanks,
Ryan
Subtracting the timestamps gives you 536457600 seconds, which is
correct, but ( $dif_s / 60 / 60 / 24 ) gives you the actual number of
days between these t
On Wed, July 6, 2005 12:07 pm, Ryan A said:
> I'm confused, this should give me the age as 17 instead of 16...but it
> does
> not...any ideas why?
>
> $age="1988-07-06";
>
> $day1=strtotime($age);
> $day2 = strtotime(date("Y-m-d"));
> $dif_s = ($day2-$day1);
> $dif_d = ($dif_s/60/60/24);
> $age =
On Jul 6, 2005, at 2:35 PM, Edward Vermillion wrote:
On Jul 6, 2005, at 2:07 PM, Ryan A wrote:
Hi,
I'm confused, this should give me the age as 17 instead of 16...but
it does
not...any ideas why?
Thanks,
Ryan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: htt
On Jul 6, 2005, at 2:07 PM, Ryan A wrote:
Hi,
I'm confused, this should give me the age as 17 instead of 16...but it
does
not...any ideas why?
Thanks,
Ryan
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
If I change $day2 to =time
try +one month
- Original Message -
From: PHP
To: php
Sent: Wednesday, December 22, 2004 6:38 PM
Subject: [PHP] Date problem?
echo date('F',strtotime("next month"));
This is printing February right now. Does this sound right or is this a but
in strtotime()? is "next mon
Ok,
I was using the download version of the manual and it didn't have any user
comments on this, but the online one does.
Hi,
I did use the +1 month, but I was just curious as to what was up.
Try this instead...
echo date('F',strtotime("+1 month"));
read through the user comments at...
http:/
Hi,
I did use the +1 month, but I was just curious as to what was up.
Try this instead...
echo date('F',strtotime("+1 month"));
read through the user comments at...
http://us2.php.net/manual/en/function.strtotime.php
there are some things pertaining to your situtation
-Chris
On Wed, 22 Dec 2004
Try this instead...
echo date('F',strtotime("+1 month"));
read through the user comments at...
http://us2.php.net/manual/en/function.strtotime.php
there are some things pertaining to your situtation
-Chris
On Wed, 22 Dec 2004 15:38:38 -0800, PHP <[EMAIL PROTECTED]> wrote:
>
> echo date('F'
* Thus wrote Shaun ([EMAIL PROTECTED]):
> Hi,
>
> Why does the following code print '00', surely it should print '08', I'm
> baffled!
>
> date("H", mktime(8, 0, 0, 0, 0, 0));
kinda wierd, I say blame it on the y1969 bug.
make sure your day and month don't go backwards, that seems to be
what t
Hi,
That looks like a unix timestamp. Try this:
Echo date("Y/m/d h:i:s", "1056044640");
www.php.net/date
Check that link to see the lettering codes and the syntax, I
might be off on what I typed up there, but you'll get the concept.
-Dan Joseph
-Original M
>I am storing dates in an Access database in a field with a "Date/Time" Type
>the date is being generated using date("n/d/Y h:i a"). It appears to be
>stored in Access correctly but when I output it to the page using PHP it
>seems to be changing. It is being stored in the database as "6/19/2003
- Original Message -
From: "Vinesh Hansjee" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, March 31, 2003 6:55 AM
Subject: [PHP] Date Problem - Last Day Of Month
> Hi there, can anyone tell me how to fix my code so that on the last day of
> the month, my code doesn't repeat th
change
for ($i=1; $i<=12; $i++)
to
for ($i=1; $i<12; $i++)
--- Vinesh Hansjee <[EMAIL PROTECTED]> wrote:
> Hi there, can anyone tell me how to fix my code so
> that on the last day of
> the month, my code doesn't repeat the months...
> What the code suppose to do is, makes a drop down
> box fro
> Hi there, can anyone tell me how to fix my code so that on the last day of
> the month, my code doesn't repeat the months...
I'm not sure what you mean by this, but I can be a moron on this list
sometimes and the clear answer usually comes to me about 2 seconds after I
hit the send button. Do yo
> From: "Alexander Tsonev" <[EMAIL PROTECTED]>
>
> Hello,
> I would ask you a question about date type
> if I have a variable from date type ($newdate) such as 2003-02-17
> how can I separate $newdate into 3 different variables? I want to create
> such variables:
> $day=17
> $month=2
> $year=2003
> Our school holds many seminars of varying durations and dates. I want
to
> make a page which says "What's on today" which will show all the
seminars
> that are on today. However the entry in the database will show two
fields
> "Commencing Date" and "Ending date".
>
> Is there a routine in PHP I
At 05:23 PM 12/31/02 +0800, Denis L. Menezes wrote:
Hello friends.
Is there a routine in PHP I can use to find if today's date fits between
the commencing date and the ending date?
SELECT * FROM Table WHERE NOW() >= StartDate AND NOW() <= EndDate
Rick
--
PHP General Mailing List (http://
At 19:32 03/12/2002 +0800, Jason Wong wrote:
Assuming the column holding the the birthday is called 'birthday':
[snip]
Many thanks!
> * give me actors whose birthdays fall between two dates (ie: Aries)
This one is easy, use the BETWEEN clause in your SELECT statement. Consult
manual for det
On Tuesday 03 December 2002 18:29, James Coates wrote:
> Perhaps you could throw a clue my way, in that case.
> I have an actor database (mySQL again) which has actor dates of birth in
> '-MM-DD' format. I want to be able to query against that ignoring the
> year:
>
> * give me actors who hav
At 18:44 02/12/2002 -0500, John W. Holmes wrote:
> Can you help me for this ?
Yeah, I already did:
Perhaps you could throw a clue my way, in that case.
I have an actor database (mySQL again) which has actor dates of birth in
'-MM-DD' format. I want to be able to query against that ignori
> Thanks for this,
> I understand how to update in date in database, but I need when I get
date
> from database to increase or decrease before to save in database.
>
> Can you help me for this ?
Yeah, I already did:
> > You can select out the date you have now, use strtotime() to make it
> > int
Thanks for this,
I understand how to update in date in database, but I need when I get date
from database to increase or decrease before to save in database.
Can you help me for this ?
"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
001501c2999b$d24a71f0$7c02a8c0@coconut">news:001501c2999b
> I want to get date from database, to increment ot decrement it with
some
> days, to show the date and after thath
> if user confirm it to save it to database.
There are a ton of ways you can do it. You can select the date and it's
inc/dec value in the same statement:
SELECT datecol, datecol + I
It's in -MM-YY
"Justin French" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> on 02/12/02 9:59 AM, Rosen ([EMAIL PROTECTED]) wrote:
>
> > I want to get date from database, to increment ot decrement it with some
> > days, to show the date and after thath
> >
on 02/12/02 9:59 AM, Rosen ([EMAIL PROTECTED]) wrote:
> I want to get date from database, to increment ot decrement it with some
> days, to show the date and after thath
> if user confirm it to save it to database.
And in what format is the date currently stored? -MM-DD? MySQL
timestamp? Uni
c0@coconut">news:002601c29965$7862e950$7c02a8c0@coconut...
> What exactly do you want to do? I'm not a mind reader...
>
> ---John Holmes...
>
> > -Original Message-
> > From: Rosen [mailto:[EMAIL PROTECTED]]
> > Sent: Sunday, December 01, 2002 12:54 PM
&g
What exactly do you want to do? I'm not a mind reader...
---John Holmes...
> -Original Message-
> From: Rosen [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, December 01, 2002 12:54 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Date problem
>
> Thanks,
> But
Thanks,
But I need before to save date in database to do some checks with the
inc/dec date.
Cal you help me ?
Thanks,
Rosen
"John W. Holmes" <[EMAIL PROTECTED]> wrote in message
002301c29960$21d6a360$7c02a8c0@coconut">news:002301c29960$21d6a360$7c02a8c0@coconut...
> > I have one problem:
> > Dat
> I have one problem:
> Date field in MySql database with value as "2002-31-12".
> I want to increment or decrement this date and to put it again in
table.
> Can someone help me to increment or decrement date with some days?
UPDATE yourtable SET yourcolumn = yourcolumn + INTERVAL 1 DAY WHERE ...
say it again?
--
Maxim Maletsky
[EMAIL PROTECTED]
On Sun, 10 Nov 2002 12:37:48 +0800 "Michael P. Carel" <[EMAIL PROTECTED]> wrote:
> to all;
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On Friday 16 August 2002 17:24, Kae Verens wrote:
> when I place date("h:i a") in a page on my server, and view it in a
> browser, I am returned: "02:51 pm". According to the server itself,
> though (logged in through ssh), using "date", it is 3:51. gmdate("h:i
> a") returns the same 2:51 time. Th
> >> SELECT COUNT(*) AS c
> >> FROM users_table
> >> WHERE UNIX_TIMESTAMP( user_regdate ) > '1022882400'
> >
> > The only way you can do it with a char column is to select the
entire
> > database, load it into a PHP array, using strtotime() to (hopefully)
> > convert "May 29, 2002", etc, into a un
>> SELECT COUNT(*) AS c
>> FROM users_table
>> WHERE UNIX_TIMESTAMP( user_regdate ) > '1022882400'
>
> The only way you can do it with a char column is to select the entire
> database, load it into a PHP array, using strtotime() to (hopefully)
> convert "May 29, 2002", etc, into a unix timestamp,
So what did you get? Did it work? (No. I doubt it...) Don't just post a
"question" like "Here's what I'm doing...fix it"
Anyway, your really wasting your time by not using a date or timestamp
column. If you don't understand why or realize how easy it is to change
it, you've got a lot of learning
On Thu, 6 Jun 2002, andy wrote:
> I would like to count the users out of a mysql db who registered after a
> certain date.
>
> The column I have in the db is a char and I do not want to change this
> anymore.
> This is how a typical entry looks like: May 29, 2002
>
> This is how I tryed it:
>
>
On 28 Apr 2002 at 14:48, Nick Wilson wrote:
> I have a field in MySQL db like this: date TIMESTAMP,
> and it looks pretty regular like this: 20020428011911
If you've got the data in your database then do the date/time
conversions as part of your sql query - it's more efficient.
Something like
On Sunday 28 April 2002 21:10, Nick Wilson wrote:
> * and then Richard Emery declared
>
> > Third, let Mysql do the conversion for you. For instance if you
> > timestamp field is named "mydate":
> > SELECT DATE_FORMAT(mydate,"%e %b %Y") AS thedate FROM mytable
>
> Nice one, cheers Richard.
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
* and then Richard Emery declared
> Third, let Mysql do the conversion for you. For instance if you timestamp
> field is named "mydate":
> SELECT DATE_FORMAT(mydate,"%e %b %Y") AS thedate FROM mytable
Nice one, cheers Richard.
I didn't know a
First, the timestamp that is retrieved from mysql is NOT the same as is
required for PHP.
Second, do you REALLY wan the Day of the Week (Mon, Tue, Wed) or the date of
the month (1,2,3,4,5,6,...)?
Third, let Mysql do the conversion for you. For instance if you timestamp
field is named "mydate":
date() is your answer, use it in the piece of code generating the query.
$DateTime = date("Y-m-d H:i:s); // "2002-02-18 16:10:43"
Niklas
-Original Message-
From: eoghan [mailto:[EMAIL PROTECTED]]
Sent: 18. helmikuuta 2002 16:14
To: [EMAIL PROTECTED]
Subject: [PHP] date problem
hello
> For a newspaper, a week start on sunday and ends in a saturday.
>
> Media planners divide ads in newspapers by monhs and than by weeks,
> respectively.
Well, this _seems_ contradictory to your original "definition", but I
got it.
> so let's say:
>
> january 2001 started in a monday
>
> Su M
stion!
Rom
- Original Message -
From: jeremy brand <[EMAIL PROTECTED]>
To: Romulo Roberto Pereira <[EMAIL PROTECTED]>
Cc: php-general <[EMAIL PROTECTED]>
Sent: Thursday, January 18, 2001 7:14 PM
Subject: Re: [PHP] date problem: some months have 5 weeks... how I
discoverw
All months have more than 4 weeks except February (but only when it is
not a leap year).
I'm probably not understanding what exactly you are trying to do.
By your definition then, wouldn't this month only have 3 weeks?
January 2001
Su Mo Tu We Th Fr Sa
1 2 3 4 5 6
7 8 9 10 11
can't think of exactly the math, but get the weekdayday of the 1st,
divide how many days in the month/7, and it should be easy enuff.
use a combination of date() and mktime() to get the first day of the
month methinks.
Gfunk - http://www.gfunk007.com/
I sense much beer in you.
65 matches
Mail list logo