All pastes #81218 Raw Edit

Turophile

public php v1 · immutable
·published 2006-07-07 07:22 UTC
rendered paste body
function datefix($date)        {        $date = explode(" ", $date);        $datestamp = explode("-",$date[0]);        $datestamp = $datestamp[2]."-".$datestamp[1]."-".$datestamp[0];        $timestamp = explode(":",$date[1]);        $timestamp[0] = $timestamp[0] - 0;	if($timestamp[0] >= 12) { if($timestamp[0] > 12) { $timestamp[0] = $timestamp[0] - 12; } $ampm = "pm"; } else { $ampm = "am"; }        $timestamp = $timestamp[0].":".$timestamp[1]." ".$ampm;        $date = $timestamp." on the ".$datestamp;        return $date;        }