Here is a function for time stam (UNIX & MySQL)
Simple use
echo formatDate($input);
or
echo formatUnixDate($input);
//#########################################################
// format the date correctly from MySQL timestamp
function formatDate($val)
{
if ($val==""){return "unknown";}
// split up the timestamp
$year=substr($val,0,4);
$month=substr($val,4,2);
$day=substr($val,6,2);
$hh=substr($val,8,2);
$mm=substr($val,10,2);
// convert it into a standard timestamp and format it
$date = date("d.M.Y H:i", mktime($hh, $mm, 0, $month, $day, $year));
return $date;}
//#########################################################
//#########################################################
// format the date correctly from UNIX timestamp
function formatUnixDate($val)
{
if ($val==""){return "unknown";}
$date = date("d.M.Y H:i", $val);
return $date;}
//#########################################################