Re: [PHP] What was the unix timestamp of last week, Monday 12:00 am?

2009-04-14 Thread Jan G.B.
2009/4/13 René Fournier m...@renefournier.com:
 What was the unix timestamp of last week, Monday 12:00 am?


Depends on when I read your message.

SCNR :-)

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



Re: [PHP] What was the unix timestamp of last week, Monday 12:00 am?

2009-04-13 Thread Robert Cummings
On Sun, 2009-04-12 at 20:12 -0600, René Fournier wrote:
 I'm trying to write a [simple] function, such that:
 
 function earlier_unix_timestamp () {  
   $now = mktime();
   [...]
   return $then;  // e.g., 1238983107
   }
 
 Anyone have something already made? There seem to be many ways to skin  
 this cat, with date() arithmetic, etc., but the exceptions (Jan 1,  
 first day of the month, etc.) are driving me crazy.

?php

function earlier_unix_timestamp()
{
strtotime( 'last monday' );
}

?

Cheers,
Rob.
-- 
http://www.interjinn.com
Application and Templating Framework for PHP


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



[PHP] What was the unix timestamp of last week, Monday 12:00 am?

2009-04-12 Thread René Fournier

I'm trying to write a [simple] function, such that:

function earlier_unix_timestamp () {
$now = mktime();
[...]
return $then;  // e.g., 1238983107
}

Anyone have something already made? There seem to be many ways to skin  
this cat, with date() arithmetic, etc., but the exceptions (Jan 1,  
first day of the month, etc.) are driving me crazy.


...Rene

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