I am displaying contents of a datetime field in mysql in a table with php, and only want to show date Is there any way to change or do this, or should the actual string be edited or trim? Using Stratotime ...
An easy way is to: / P>
$ date = "2009-01-27 14:30:22"; Echo sprayatime ("% d% m% Y", strotamom ($ date));
i.e. Change your mysql date to one time value, then reformat it with it.
Although it only works for dates that can be presented by anyone - hence a date is used on January 1, 1970 or later
date range of PAR. ..
For a more complete approach that should face better with historical dates:
$ date = new void date ("2009-01 -27 14: 30:22 "); Transcript $ date- & gt; Format ("% d% m% Y");
... or use your DB
Alternatively, select your DB format
for you col1, col2 , DATE_FORMAT (col2, '% W% M% Y') as mytable with col2readable;
Comments
Post a Comment