Everyting can be found on php.net. I am programming in PHP for more than three years and I still very frequently use php.net manual.
header("Content-Type: image/png");
///dimensions
$im = @imagecreate(110, 20)
or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 233, 14, 91);
//use date() function to get date Y- year, m- month, d- day, H- hour, i- minute, s- second
//other date parameters can be found in http://www.php.net/manual/en/function.date.php
$date = date("Y-m-d H:i:s");
imagestring($im, 1, 5, 5, "Date: $date", $text_color);
imagepng($im);
imagedestroy($im);