At some point in your programming carrier you going to be asked to deal with a date.  I've found PHP has a slew of really useful date utilities to manipulate and change the format of your date or time.  The date function is very useful in formatting your date the way you want to display it.  There are a slew of different setting you can send to the function to format the date exactly how you want it. You can check the PHP website for all the different mask this function supports.

The one draw back to the date function is it only takes Unix time stamps.  The one function I feel fixes this problem is the strtotime function.  The nice thing about this function is you can hand it a date in just about any format and it will convert it into a Unix time stamp.

Now to really take full advantage of this if you understand how a Unix time stamp is derived then manipulating your date is very easy.  A Unix time stamp is basically the number of seconds that has passed since January 1 1970. Usually this is referred to the Unix Epoch.  Since this is all in seconds it makes manipulating our date a lot easier.  Say you need to add 7 days to a date well this is how one would do that:

$newDate = strtotime( $oldDate ) +  604800; //( 7 * 24 * 60 * 60 )

With this we can figure out just about any date between January 1, 1970 to January 19, 2038.  Hopefully by the time this date flips around I'll be retired and sipping drinks on a beach in the Bahamas. But back to reality there are other import date utility we need to look at.  Just the other day I was trying to figure out a way to have my code tell me how many days there are in a month.  I started looking and for a while thought I was going to have to write a function of my own but fortunately I found a nice function already available in cal_days_in_month.  This function takes three values, the first is what calendar do you want to use, the second is the month and the third is the year.  For me the first value is CAL_GREGORIAN since I live in the United States.  It may be different for you so check PHP's website to find the right calendar for you.

There are a lot more useful date functions but these are the most common ones I've needed to use in the past. When you need something different than what you normally use look on the PHP website first before writting a new function.