> > --- "Bob" <helldrivers@> wrote:
> > >
> > > I'm trying to calculate the 2nd Sun in Nov of the current year, using php
> > > 4.3
> > > 
> > > Tried strtotime(); but maybe I was doing something wrong.
> > > Speed is not too important, as it's only called one.
> > > Any advice on how to tackle this?
> > > 
> > > Thanks, Bob.

This works for me on PHP5 on a Linux system.  Does it work for you?

print date("Y-m-d", strtotime("second Sun Nov 2007"));

Thanksgiving is on the third Thursday in November in the US so it would be:

print date("Y-m-d", strtotime("third Thu Nov 2007"));

Now, if we could get it to calculate lunar phases for determining Easter.... 
The somewhat inaccurate calculation is the first Sunday following the first
full moon after the vernal equinox (ie Mar 21).  However, this is not always
true and the full moon is actually looked up from old tables rather than the
real full moon as observed astronomically.

James Keeline

Reply via email to