Re: echoing date of first and last day of current week.
| From: | Noodle Snacks | Date: | Tue, 19 Nov 2002 09:33:01 +0000 |
| Subject: | Re: echoing date of first and last day of current week. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-125042@lists.php.net to get a copy of this message | ||
I ended up using this:
$time = time();
$weekday = date('w',$time);
$suntimestamp = $time - ($weekday * 86400);
$sattimestamp = $suntimestamp + 604800;
echo 'Words for the week from '.date('jS F Y',$suntimestamp).' to
'.date('jS F Y',$sattimestamp).'.<br>';
--
JJ Harrison
lizner2002@yahoo.com.au
"Noodle Snacks" <webmaster@tececo.com> wrote in message
news:20021118055725.21851.qmail@pb1.pair.com...
> I want to get the unix timestamps of the first and last days of this
week...
>
> Currently I have this:
>
> echo 'Words for the week from '.date('jS F Y',strtotime("last
> sunday")).'
> to '.date('jS F Y',strtotime ("next
> saturday")).'.<br>';
>
> on saturday this showed the 10th to 23rd... Is there a good way to do this
> mathematically (for speed) or can someone think of a better string to
parse?
>
>
> --
> JJ Harrison
> lizner2002@yahoo.com.au
>
>