>I have a date comparison problem that I'm sure is simple enough but I'm just
>not experienced enough to figure it out. I simply want to grab every entry


Um.

First of all, better code would be:
my @now = localtime( );
$now[5] += 1900;
$now[4] += 1;
$currenttime = sprintf( '%04d%02d%02d%02d%02d%02d', @now[5, 4, 3, 2, 1, 0] );

Second, to add/subtract dates in perl and other languages, check out Date::Calc.

Third, in MySQL you cand do something like:

WHERE some_date>DATE_SUB( NOW( ), INTERVAL 5 DAY)

Check out the MySQL manual for more info on DATE_SUB.

--Bill




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to