Re: [PHP] echoing date of first and last day of current week.

2002-11-18 Thread BigDog
Probably the best way is to convert the times all into seconds and then
do the math to get the last day of the week.

Should be relatively easy...

HTH

On Mon, 2002-11-18 at 05:57, Noodle Snacks 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]
-- 
.: B i g D o g :.



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




Re: [PHP] echoing date of first and last day of current week.

2002-11-18 Thread Maxim Maletsky
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




[PHP] echoing date of first and last day of current week.

2002-11-17 Thread Noodle Snacks
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