Hi Guys,
when a user logs into my site mysql records the date as:
i was after making it say:PHP Code:2007-04-29 22:13:42
how would i go about doing this?PHP Code:April 29, 2007, 22:13 pm
Thanks guys
Graham
| SitePoint Sponsor |



Hi Guys,
when a user logs into my site mysql records the date as:
i was after making it say:PHP Code:2007-04-29 22:13:42
how would i go about doing this?PHP Code:April 29, 2007, 22:13 pm
Thanks guys
Graham

John Conde | Facebook | Twitter
Brainyminds Merchant Account Services I Love Code eBook Giant
Authorize.Net: AIM API | ARB API | CIM API Get the FREE code!
Merchant Accounts 101 | Ecommerce 101



thanks mate
Graham

Or better yet use the appropriate mySQL command to retrieve it the way that you want rather than using PHP to convert it after retrieval.
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">



Hi Felgall,
could you tell me the command i would need to do that? that sounds good aswell (if slightly better)
this is what i did to make it convert:
thanks matePHP Code:$date_format = $row["login"];
$display_date = date("F j-Y-H:i a", strtotime($date_format));
echo $display_date;
Graham



You can also use the select command of mysql to retrieve the date like:
select date_format(logged_on,'%M %d, %Y, %H:%i %p') as date1 from table_name
Last edited by barbara1712; Apr 30, 2007 at 06:47.
Bookmarks