note 48939 deleted from function.checkdate by aidan
| From: | aidan@php.net | Date: | Thu, 10 Feb 2005 05:34:36 +0000 |
| Subject: | note 48939 deleted from function.checkdate by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-84768@lists.php.net to get a copy of this message | ||
Note Submitter: jhonald at cantv dot net
----
Example for sum a day to the actual date, using an hour limit. For example in this case when the
time will be over 17:00 hrs the program will sum a day to the actual data.
<?php
$horaq = date('H');
print $horaq."<br>";
$anoq = date('Y');
$mesq = date('m');
$diaq = date('d');
$fechaq = $diaq."/".$mesq."/".$anoq;
print $fechaq;
if ($horaq>=17) {
$diaq = $diaq + 1;
if (strlen($diaq)==1) {
$diaq = "0".$diaq;
}
if(checkdate ($mesq,$diaq,$anoq)){
print "<br>".$diaq."/".$mesq."/".$anoq;
}else{
$diaq = "01";
$mesq = $mesq + 1;
if (strlen($mesq)==1) {
$mesq = "0".$mesq;
}
if (checkdate ($mesq,$diaq,$anoq)) {
print "<br>".$diaq."/".$mesq."/".$anoq;
}
else {
$mesq = "01";
$anoq = $anoq + 1;
print "<br>".$diaq."/".$mesq."/".$anoq;
}
}
}