Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

First Sunday - Last Sunday

Status
Not open for further replies.

stoolpigeon

Programmer
Aug 1, 2001
309
US
I have an intranet system that is being used for time and attendance. Now my company wants to bring our Chicago office in on the fun.

We are in Arizona where we do not have daylight saving time.

I will know when a person logs in if they are here or in Chicago. If they are in Chicago I will need to check if the date is between the first sunday in April and the last sunday of October.(So I adust the time the correct amount)

I can think of a couple ways to go about this- looping through the first and last 7 days and looking for Sunday- but I am wondering if I am making it more complicated than need be. I've looked in the manual and I didn't see any functions that jumped out at me- suggestions are welcome.

thanks,
Ron
 
There are some PEAR classes to perform this kind of calculation.

If you are running PHP 4.3.0, you have the latest version. Did around on your system's drive for a directory named "PEAR".

If you are running an older version of PHP, the PEAR classes shipped with PHP are old, out-of-date and beta. Take a look here: for the updated classes. Want the best answers? Ask the best questions: TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top