|
Posted by lvaro G. Vicario on 08/15/07 21:48
Álvaro G. Vicario escribió:
> FFMG escribió:
>> Given a time I want to know if it is today or yesterday, (on the
>> server).
>
> function is_yesterday($timestamp){ // NOT TESTED
> $start = mktime(0, 0, 0,
> date('n', time()), date('j', time()), date('Y', time()));
> $end = mktime(0, 0, 0,
> date('n', time()), date('j', time()), date('Y', time()));
>
> return ($timestamp>=$start) && ($timestamp<$end)
> }
I'm sorry, I didn't understand the specs and my code contains a huge
type that makes it useless; $end should be;
$end = mktime(0, 0, 0, date('n', time()), date('j', time())+1, date('Y',
time()));
Anyway, I hope it can at least give some ideas...
--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor austrohúngaro: http://www.demogracia.com
--
[Back to original message]
|