« MySQL Pop Quiz #9 | Main | MySQL Pop Quiz #10 »
MySQL DATE_FORMAT() and PHP DATE() Tool
By Carsten | March 3, 2008
JavaScript? Check. Ajax? Check. “Beta” tag? Check. Bright colors? Check. Big fonts? Check. Rounded corners? Check*.
In a fit of “someone really ought to have made such a tool already” and wanting to play a bit with Javascript and DOM, I humbly present my Web 2.0 - compliant MySQL DATE_FORMAT() and PHP DATE() tool.
Not very fancy or anything, but it should go some way toward saving you the effort of looking up formatting codes and running your scripts for the nth time to check whether things work or not.
Any and all suggestions for improvements are appreciated!
Check out the MySQL DATE_FORMAT() and PHP DATE() tool.
*on Firefox anyway…
March 3rd, 2008 at 1:34 pm
Note that using PHP’s date() may be quite dangerous, because it depends on the platform - ie on some distros you may not be able to use negative timestamps, so no birthdates before 1971… MySQL is safe on that part, but for PHP it’s worth using a date class of some sort.
March 3rd, 2008 at 6:10 pm
Love the beta tag.
January 7th, 2010 at 9:10 pm
Here is a good website for formatting dates using the MySQL date_format function