License: GNU General Public License
Description: Keeps UK date formating dd/mm/yyyy
displayed correctly, and does not output in US format of mm/dd/yyyy.
Original idea of using array by swativ but his code still displayed in US format so i did not think that this snippet was classed as a revision.
<?php #setlocale (LC_ALL, 'en_UK'); #This was ignored dont know why!! #and caused me to write this solution $UKdate = "01/08/2003"; #string stored in UK format in MySQL database or string variable $stringArray = explode("/", $UKdate); #explode the string into the array delimited by / $newdate = ($stringArray."/".$stringArray."/".$stringArray); #newdate is set to be first 2 parts of array reversed $udate = strtotime($newdate); #use strtotime to convert $newdate $convertedDate = date("l jS F Y", $udate); #converted date displays Friday 1st August 2003 #see more date formating on phpbuilder echo $convertedDate; #print out result #Acknowledgements to original script by swativ which #gave me the idea of using the array, but still output it in US format ?>