note 60106 added to function.date
| From: | lch2003 at gmail dot com | Date: | Tue, 27 Dec 2005 02:58:58 +0000 |
| Subject: | note 60106 added to function.date | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-100760@lists.php.net to get a copy of this message | ||
A function to get a week ... start and end ...
if ( !function_exists('get_week_start_and_end') ) {
function get_week_start_and_end($year,$month,$weeks){ //Make by 2005/8/25.
$weeks=$weeks+1;//Add at2005/8/26
$day=7-date("w", mktime(0,0,0,$month,1,$year))+(($weeks-1)*7);
$the_date=date("w", mktime(0,0,0,$month,$day,$year));
$first_day=mktime(0,0,0,$month,$day,$year);
$first_day=$first_day-(($the_date-1)*(24*3600));
$end_day=mktime(0,0,0,$month,$day,$year)+((5-$the_date)*(24*3600));
return date("Y/m/d", $first_day) . " 至 " . date("Y/m/d",
$end_day);
}
}
----
Manual Page -- http://www.php.net/manual/en/function.date.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60106
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60106&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60106&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60106&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60106&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60106&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60106&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60106&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60106&report=yes
Search -- http://master.php.net/manage/user-notes.php