note 87001 added to function.date

From: Date: Fri, 14 Nov 2008 08:43:07 +0000
Subject: note 87001 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-146516@lists.php.net to get a copy of this message
<?php /* Find out start and end date of current week. I am assuming that week starts at sunday and ends at saturday. so a typical week will look like this: sun,mon,tue,wed,thu,fri,sat if you find any bug/error, please email me. */ //sunday = start of week $sat = 6; //saturday = end of week $current_day=date('w'); $days_remaining_until_sat = $sat - $current_day; $ts_start = strtotime("-$current_day days"); $ts_end = strtotime("+$days_remaining_until_sat days"); echo date('m-d-Y',$ts_start); //start date echo '<br>'; echo date('m-d-Y',$ts_end); //end date /* OUTPUT (m-d-y): 11-09-2008 11-15-2008 */ ?> ---- Server IP: 203.199.69.133 Probable Submitter: 122.160.20.249 ---- Manual Page -- http://www.php.net/manual/en/function.date.php Edit -- https://master.php.net/note/edit/87001 Del: integrated -- https://master.php.net/note/delete/87001/integrated Del: useless -- https://master.php.net/note/delete/87001/useless Del: bad code -- https://master.php.net/note/delete/87001/bad+code Del: spam -- https://master.php.net/note/delete/87001/spam Del: non-english -- https://master.php.net/note/delete/87001/non-english Del: in docs -- https://master.php.net/note/delete/87001/in+docs Del: other reasons-- https://master.php.net/note/delete/87001 Reject -- https://master.php.net/note/reject/87001 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#146516) next »