» Don't do your own timestamp calculations
If you have ever done something like time() + (60 * 60 * 24 * 7) to get the time at this minute next week then you are guilty of doing your own timestamp calculations. There hundreds of thousands of lines of code that are written line this and they will all produce improper results when the next week involves a timezone change. Such is the case with daylight savings time. There are plenty of well written date and time libraries out there that know how to properly handle timezone changes and other quirks. In PHP 5.2 they have enabled the DateTime class by default which allows you to do something like:
modify('+1 week');
echo $time->format('r');
?>
If you are running on an older version of PHP then running mktime(date('H'), date('i'), date('s'), date('n'), date('j') + 7, date('Y')) produces the same results but isn't as readable. When you write your own calculations without regard for obstacles such as DST and leap year then ultimately your code is going to end up an hour or a day off somewhere and producing irrational results. This is why languages such as PHP and Java offer time manipulation classes that can hide all the mind numbing exceptions that apply to time.
