PHPBuilder - Start and End of Week



RSS Twitter
Snippets Calendars Dates

Start and End of Week

by: Sunny Rajpal
|
March 6, 2004

Version: 1.0

Type: Function

Category: Calendars/Dates

License: GNU General Public License

Description: Start and End of Week



//determine if given timestamp is within this week
function WithinWeek($TimeStamp)
{
	$StartOfWeek = mktime(0,0,0,date("n"),(date("j")-date("w")),date("Y"));
	$EndOfWeek = mktime(23,59,59,date("n"),(date("j")+(6-date("w"))),date("Y"));
	return ($TimeStamp > $StartOfWeek && $TimeStamp < $EndOfWeek);
}

Comment and Contribute

Your comment has been submitted and is pending approval.

Author:
Sunny Rajpal

Comment:



Comment:

(Maximum characters: 1200). You have characters left.