Some examples of how to use the getdate( ) function in PHP
This example shows how to use the getdate() PHP function to display the current date and calculate the remaining days to the end of the year.
<?php
// Returns an associative array containing the date information of the timestamp
$date = getdate();
// Get the value of current day,month and year
$mday = $date['mday'];
$month = $date['month'];
$year = $date['year'];
// Parse textual datetime description into a Unix timestamp
$end_of_year = strtotime("12/31/$year");
$diff = $end_of_year - time();
$days = floor( $diff / (60*60*24) );
echo "Today is $mday $month $year, and ";
echo "there are $days days at the end of the year";
?>