Jump to content

Archived

This topic is now archived and is closed to further replies.

shill

Formating date from mySql query

Recommended Posts

I’m trying to format the date from my query. Here’s what I’ve got so far.

[code]if ($r = mysql_query ($query)) {

    while ($row = mysql_fetch_array ($r)) {
        print "<tr><td>{$row['show_date']}</td>
        <td>{$row['show_city']}, {$row['show_state']} {$row['show_country']}</td>
        <td>{$row['show_venue']}</td>
        \n";
    }[/code]

I think I may need something like this but I’m not sure.

[code]$show_date = date("m.d.y");[/code]

Thanks for any help.

Share this post


Link to post
Share on other sites
You'll want to do something like this:
[code]$date = date("d.m.y" , strtotime($row['show_date']))[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.