For UK English date format in Phorum;
In the lang directory, save a copy of english.php as uk.php.
Edit uk.php and replace the original function date_format with the following;
function date_format($datestamp){
$sDate = substr($datestamp, 8, 2);
$sDate = $sDate.substr($datestamp, 4, 4);
$sDate = $sDate.substr($datestamp, 0, 4);
$sDate = $sDate.substr($datestamp, 10, 6);
return $sDate;
}
Save the file, goto Phorum admin page, choose 'Phorum Setup',
choose 'Global Options',
under the 'Default Language' drop down list choose 'Uk'.
------------------------------------
A quick explantion with MySQL...
$datestamp uses info from a MySQL DATETIME fieldtype. MySQL retieves and displays
DATETIME values in 'YYYY-MM-DD HH:MM:SS' format.
substr returns part of a string specified by 'start' and 'length' parameters (starting at 0).
So each of the values in $datestamp string corresponds to a 'location' number between 0 and
18, i.e the month is found at locations 5 and 6, the year at locations 0 through 3.
substr($datestamp, 4, 4) will return '-MM-', so we build up the required format in stages.
We could of course just specify;
$sDate = substr($datestamp, 8, 2).substr($datestamp, 4, 4).substr($datestamp, 0, 4).substr
($datestamp, 10, 6);
Hope this helps, I'm just learning PHP also.
Checks Date-Input from HTML-Forms and converts to YYYY-MM-DD Format for MySQL Date-Fields Categories : MySQL , Date Time , PHP , Databases Simple function to return the number of days in a time span between 2 given dates. Categories : PHP , Date Time , MySQL , Databases List people whose birthdays fall on the current Day and Month
Categories : Databases , Date Time , MySQL , PHP Simple conversion functions to change MySQL dates to arrays, arrays to MySQL dates.
Categories : PHP , Arrays , Date Time , Databases , MySQL PHP Calendar Web App Categories : PHP , Databases , MySQL , Date Time , Calendar Count how many weeks in the month have a specified day, such as Mon, Tue, etc. Var avail - number of days - first day name of the month, occurrences of Sun, occurrences of Mon, etc. Allows you to calculate number of working hours exclude Holidays. Categories : Calendar , Date Time , PHP , Databases , MySQL mysql_escape_string Categories : PHP , MySQL , Databases , Strings How to Insert a Date Format Into MySQL from PHP Categories : PHP , Databases , MySQL , Date Time , Beginner Guides In Mysql, the 'datetime' data type is used to store date that looks like '2007-10-16 16:26:30'. we are going to design a function called mysqldate() that takes a mysql date and output format as input and outputs a well formated date. Categories : PHP , Date Time , Databases , MySQL mysql date/time converters Categories : PHP , MySQL , Databases , Date Time Mimic ASP's GetString function with PHP Categories : PHP , Databases , MySQL , Strings Data Retrieve from Mysql using AJAX with PHP Categories : PHP , AJAX , Date Time , Databases , MySQL Finding the day of the week for a specific date.
Categories : PHP , Databases , MySQL , Date Time MySQL and substrings. Categories : MySQL , Strings , Date Time , Databases formating MySQL Timestamp to get a propper Output.
related : Timestamp, ereg_replace, mysql, substr Categories : MySQL , PHP , Date Time , Databases