note 38579 added to function.date
| From: | groge at dreamwiz dot com | Date: | Sun, 28 Dec 2003 14:38:46 +0000 |
| Subject: | note 38579 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-62604@lists.php.net to get a copy of this message | ||
function ArrTermDateList($start_date,$end_date){
$sd = split('[-,/]',$start_date);
$ed = split('[-,/]',$end_date);
//for ($x = mktime (0,0,0,$sd[1], $sd[2], $sd[0]) ; $x <= mktime (0,0,0,$ed[1], $ed[2],
$ed[0]); $x += 86400){
//It doesn't work perfectly. check the date below.
// 1. 2003-10-25 and 2003-10-26
// 2. 2004-03-27 and 2004-03-28
// Maybe there is more errors. but I didn't find the reason. anyway there is problem to use.
// So I changed the function like this...
for ($x = mktime (0,0,0,$sd[1], $sd[2], $sd[0]) ; $x <= mktime (0,0,0,$ed[1], $ed[2],
$ed[0]); $x = mktime (0,0,0,date("m",$x), date("d",$x)+1,
date("Y",$x)) ){
$vacation_days[] = date('Y-m-d', $x);
}
return $vacation_days
}
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+38579
Delete -- http://master.php.net/manage/user-notes.php?action=delete+38579&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+38579&report=yes
Search -- http://master.php.net/manage/user-notes.php