Jump to content


Photo

Formating date from mySql query


  • Please log in to reply
1 reply to this topic

#1 shill

shill
  • New Members
  • Pip
  • Newbie
  • 2 posts

Posted 24 April 2006 - 06:56 PM

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

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";
    }

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

$show_date = date("m.d.y");

Thanks for any help.


#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 24 April 2006 - 07:44 PM

You'll want to do something like this:
$date = date("d.m.y" , strtotime($row['show_date']))





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users