| |||||||||||
| |||||||||||
Date conversion - PHP
A simple piece of code to show you some examples of date reformatting in PHP. Frequently, you'll get dates in a format such as the ones I've started with here and want to re-arrange them, or do something more sophisticated.
My first re-arrangement simply explodes the date string and reforms it. My second converts it into seconds from 1st January 1970 (and I've taken the hour of 12, Midday, to complete the parameters to mktime) then reformats it with the date function. <?phpThe results: Date is 12/10/2006All done with easy function calls ... as we say in PHP "There's a function to do that" (written 2006-12-26 17:35:04)
Associated topics are indexed under H107 - String Handling in PHP
Some other Articles
Moving files between Windows / DOS and Linux / UnixWell House Manor and Beechfield House, Hotels, Melksham Dates, times, clickable diarys in PHP Passing GET parameters through Apache mod_rewrite Date conversion - PHP Friends and family Apache httpd and Apache Tomcat together tips Stirling at night Old dog, old tricks Room at the Inn, Guy at the station 1637 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33 at 50 posts per pageThis is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price. Link to Ezine home page (for reading). Link to Blogging home page (to add comments). |
| ||||||||||
PH: 01144 1225 708225 • FAX: 01144 1225 707126 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho | |||||||||||