Re: Get timestamp?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jay Paulson wrote:
> How would I go about getting the timestamp of a day of the week from 7 weeks
> ago?
> $lastSunday = strtotime("last Sunday");
> $Sunday7Weeks = $lastSunday - ???;

$lastsunday = strtotime("last Sunday");
$sunday7weeks = $lastsunday - (86400 * 49); // 7 weeks = 49 days

Test:
echo 'Last Sunday\'s date was '.date("m/d/y",$lastsunday);
echo '<br>7 Weeks prior to Last Sunday, the date was '.date("m/d/y",$sunday7weeks);

--
Max Schwanekamp
http://www.neptunewebworks.com/

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux