$im = imagecreate(120, 35);
$bg = imagecolorallocate($im, 180, 0, 0);
$textcolor = imagecolorallocate($im, 255, 255, 255);
date_default_timezone_set('GMT');
imagestring($im, 4, 10, 10, date('h:iA e'), $textcolor);
header("Content-type: image/png");
imagepng($im);
imagedestroy($im);