On 19 October 2010 14:59, Don Wieland <donw@xxxxxxxxxxxxxxxxxx> wrote: > Hi gang, > > I need a bailout. > > I have a fields called "sys_first_day_of_week" and the user can select one > value which will be from a menu with these options: > > Monday > Tuesday > Wednesday > Thursday > Friday > Saturday > Sunday > > Based on this "Preference" and TODAYS DATE, I want to calculate the first > day of the week. > > So if my preference is "Monday" and Today's date is 10/19/2010, I want to > return a value of: 1287374400 (which is 10/18/2010) > > if my preference is "Wednesday" and Today's date is 10/19/2010, I want to > return a value of: 1286942400 (which is 10/13/2010) > > Appreciate any help. > > Don Wieland > D W  D a t a  C o n c e p t s > ~~~~~~~~~~~~~~~~~~~~~~~~~ > donw@xxxxxxxxxxxxxxxxxx > Direct Line - (949) 336-4828 > > Integrated data solutions to fit your business needs. > > Need assistance in dialing in your FileMaker solution? Check out our > Developer Support Plan at: > http://www.dwdataconcepts.com/DevSup.html > > Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 or > higher > http://www.appointment10.com > > For a quick overview - > http://www.appointment10.com/Appt10_Promo/Overview.html > > <?php echo date('r', strtotime('-1 week', strtotime('next sunday')));" // Sun, 17 Oct 2010 00:00:00 +0100 echo date('r', strtotime('-1 week', strtotime('next monday')));" // Mon, 18 Oct 2010 00:00:00 +0100 echo date('r', strtotime('-1 week', strtotime('next tuesday')));" // Tue, 19 Oct 2010 00:00:00 +0100 echo date('r', strtotime('-1 week', strtotime('next wednesday')));" // Wed, 20 Oct 2010 00:00:00 +0100 echo date('r', strtotime('-1 week', strtotime('next thursday')));" // Thu, 14 Oct 2010 00:00:00 +0100 echo date('r', strtotime('-1 week', strtotime('next friday')));" // Fri, 15 Oct 2010 00:00:00 +0100 echo date('r', strtotime('-1 week', strtotime('next saturday')));" // Sat, 16 Oct 2010 00:00:00 +0100 ?> Take 1 week off the next day that they want. If today is the start of the week, then today will be returned. -- Richard Quadling Twitter : EE : Zend @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php