drupal format_date

function

format_date($timestamp, $type = 'medium', $format = '', $timezone = NULL, $langcode = NULL)

example

$date = format_date($timestamp, 'custom', 'd F Y');