Re: script

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

 



I'd like to get my code to calculate the time between the current date (when the page is loaded by the visitor) and the very next Tuesday at 11pm. I suspect I can do this with date("w") but I can't quite figure out how to make Tuesday the beginning or end of the week in order to accomplish this...

maybe I'm going about this the wrong way.

Again, any pointers or assistance appreciated.

Hmm... well, using date("w") will tell you what day of the week it is, and you know that 0=sunday and 2=tuesday.


use that and some logic to compute the number of days between today and the next tuesday.

Then figure out how many seconds have elapsed for today and use that in conjunction with the number of days in between and the number of seconds to get to 11pm (23*60*60).

Then substract the two... and pass that to date in the format you want.

Or something like that :)

-philip

--
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