probably, what you tried is the most elegant way. But, you got me: "mathematically"
I did *this* for you:


<?php

$res['day']             = date("d");
$res['month']           = date("m");
$res['year']            = date("Y");
$res['dayN']            = date("w");
$res['sunday']          = mktime (0, 0, 0, $res['month'], ($res['day']   -   
$res['dayN']), $res['year']);
$res['saturday']        = mktime (0, 0, 0, $res['month'], ($res['day'] + 6 - 
$res['dayN']), $res['year']);

$res['sunday_debug']    = date("r", $res['sunday']);
$res['saturday_debug']  = date("r", $res['saturday']);

echo "<pre>\n";
print_r($res);

?>

Cheers, and thank my curiousity :)


--
Maxim Maletsky
[EMAIL PROTECTED]



"Noodle Snacks" <[EMAIL PROTECTED]> wrote... :

> 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
> [EMAIL PROTECTED]
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to