<?php
# The date
$str = "Sunday the 4'th of August 2002 at 2:48pm";
# Translations English to Danish
$dayarray = array("Monday"=>"Mandag","Tuesday"=>"Tirsdag","Wednesday"=>"Onsdag","Thursday"=>"Torsdag","Friday"=>"Fredag","Saturday"=>"Lørdag","Sunday"=>"Søndag");
$montharray = array("January"=>"1","Febuary"=>"2","March"=>"3","April"=>"4","May"=>"5","June"=>"6","July"=>"7","August"=>"8","September"=>"9","October"=>"10","November"=>"11","December"=>"12");
# Split the string by spaces
$strexp = explode(" ", $str);
# If PM, add an extra 12 hours to the hours
$fakehours = substr($strexp[7], 0, strpos($strexp[7], ":"));
if (substr($strexp[7], strpos($strexp[7], ":")+3, 2) == "pm") $fakehours +=12;
# Print out the fun
echo $dayarray[$strexp[0]], ' d.', substr($strexp[2], 0, strpos($strexp[2], "'")), '.', $montharray[$strexp[4]], ' ', $strexp[5], ' ',$fakehours,":",substr($strexp[7], strpos($strexp[7], ":")+1, 2);
?>
/ LJ
www.ljweb.com