WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDES  |  PHP CLASSES  |  CODE SEARCH  |  ARTICLES SEARCH  |  PHP FORUMS  |  PHP MANUAL  |  PHP FUNCTIONS LIST  |  WEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
WeberDev's Monthly code contest PHP Code Contest
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Index
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
Mobile Dev World

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Phorum, MySQL, Language, UK date format, MySQL UK Date format
Categories : PHP, Date Time, Strings, MySQL, Databases Update Picture
Paul Coughlin
Date : Jun 01st 2000
Grade : 3 of 5 (graded 8 times)
Viewed : 16153
File : uk.php
Images : No Images for this code example.
Search : More code by Paul Coughlin
Action : Grade This Code Example
Tools : My Examples List

  Submit your own code examples 
 

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.



List people whose birthdays fall on the current Day and Month
Categories : Databases, Date Time, MySQL, PHP
MySQL and substrings.
Categories : MySQL, Strings, Date Time, Databases
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
Data Retrieve from Mysql using AJAX with PHP
Categories : PHP, AJAX, Date Time, Databases, MySQL
formating MySQL Timestamp to get a propper Output. related : Timestamp, ereg_replace, mysql, substr
Categories : MySQL, PHP, Date Time, Databases
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
bookmarker - PHP, PHPLIB, MySQL WWW based bookmark manager
Categories : MySQL, PHP, MySQL, Complete Programs, Databases
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
This program allows you to upload an ODBC ressource - i.e. an MS-Access database to a MySQL server.
Categories : Databases, MySQL, Complete Programs, PHP, Databases
mysql date/time converters
Categories : PHP, MySQL, Databases, Date Time
Mimic ASP's GetString function with PHP
Categories : PHP, Databases, MySQL, Strings
Checks Date-Input from HTML-Forms and converts to YYYY-MM-DD Format for MySQL Date-Fields
Categories : MySQL, Date Time, PHP, Databases
Finding the day of the week for a specific date.
Categories : PHP, Databases, MySQL, Date Time
Simple function to return the number of days in a time span between 2 given dates.
Categories : PHP, Date Time, MySQL, Databases