Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

mySQL date Format To PHP

Codes here !

Moderators: macek, egami, gesf

mySQL date Format To PHP

Postby rochellecanale » Thu Sep 27, 2012 7:54 pm

hey guys just want to ask how can i format the date in mysql which is YYYY-mm-dd in MM/dd/YYYY in php? because i created a payout module that displays payout transaction and i want to format the date how can i do this? please help me
rochellecanale
New php-forum User
New php-forum User
 
Posts: 4
Joined: Thu Sep 27, 2012 7:49 pm

Re: mySQL date Format To PHP

Postby rwhite35 » Fri Sep 28, 2012 3:06 am

Assuming $dbdate is the date you pulled out of your database, you could use the PHP date() to format the date string.

Code: Select all
$pdate = date("m/d/Y",$dbdate);
rwhite35
New php-forum User
New php-forum User
 
Posts: 13
Joined: Thu Sep 27, 2012 10:55 am


Return to mySQL & php coding

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.