- Convert Database date timestamp from ‘2013-10-10 01:25:39’to '10th October 2013 01:25 AM'.
- Use PHP WHILE loop and foreach() function
- Use MySQL DATE_FORMAT()
- SELECT DATE_FORMAT([1st parameter: variable login_date], 2nd parameter: the format string);
- SELECT DATE_FORMAT(login_date, ‘%D %M %Y %r‘)FROM login;
- MySql Date string format description, use % character
- for example:
%M = Name of Month
%Y = 4 digits of numeric YEAR
%r = AM/PM.
Source Link
No comments:
Post a Comment