note 65328 added to function.getdate
| From: | king_of_t3rrors at hotmail dot com | Date: | Fri, 28 Apr 2006 16:55:25 +0000 |
| Subject: | note 65328 added to function.getdate | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-110031@lists.php.net to get a copy of this message | ||
The function below is also wrong :)
This one is right ( I promise ):
{
$today = getdate() ;
$datebits=explode('-',$date);
$year = intval($datebits[strpos($formato, 'y')]);
$mon = intval($datebits[strpos($formato, 'm')]);
$day = intval($datebits[strpos($formato, 'd')]);
$y=0; $m=0;
if ( $today['year'] > $year ) {
$y=1 ;
}
if ( $today['mon'] > $mon ) {
$m=1;
}
if ( $y==1 || $m==1 ) {
return true; //past date
}
if ( $today['year'] == $year ) {
if ( $today['mon'] > $mon ) {
return true; //past date
}
if ( $today['mon']==$mon ) {
if ( $today['mday'] > $day ) {
return true; //past date
}
}
}
return false;
}
----
Server IP: 130.206.1.5
Probable Submitter: 83.52.128.120
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.getdate.php
Edit -- http://master.php.net/note/edit/65328
Del: integrated -- http://master.php.net/note/delete/65328/integrated
Del: useless -- http://master.php.net/note/delete/65328/useless
Del: bad code -- http://master.php.net/note/delete/65328/bad+code
Del: spam -- http://master.php.net/note/delete/65328/spam
Del: non-english -- http://master.php.net/note/delete/65328/non-english
Del: in docs -- http://master.php.net/note/delete/65328/in+docs
Del: other reasons-- http://master.php.net/note/delete/65328
Reject -- http://master.php.net/note/reject/65328
Search -- http://master.php.net/manage/user-notes.php