mySQL date Format To PHP

Codes here !

Moderators: macek, egami, gesf

rochellecanale
New php-forum User
New php-forum User
Posts: 4
Joined: Thu Sep 27, 2012 7:49 pm

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

rwhite35
New php-forum User
New php-forum User
Posts: 13
Joined: Thu Sep 27, 2012 10:55 am

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);


Return to “mySQL & php coding”

Who is online

Users browsing this forum: No registered users and 3 guests