Tag Archiv: snippets

Calculate Central European Summer Time (CEST)

Countries of the European Union add an hour to the time during summer to better seize sunlight, so for several months GMT 0 becomes GMT +1, GMT+1 becomes GMT-2 and so on. This is known as Central European Summer Time (CEST). This script takes a Unix timestamp and adds an hour to it (3600 seconds) if we are in this summer period.

Zodiac Signs

Updated from the "Zodiac Signs" function already posted here. The other function had some overlapping month/day areas that would determine some birthdate/sign combinations incorrectly. (ie: 10/27 as Libra instead of Scorpio.)

OddEven Class

Allows you to easily keep track of a series of items as either odd or even. Each time you check (using the "which" method) the counter increments so that the next time you check the state will have changed. This is the perfect class for using when you're outputting an HTML table and want to use different classes to differentiate between odd and even rows. Simply create a new instance and call OddEven->which() for each row!
Powered by Gewgley