Results 1 to 1 of 1

Thread: [RESOLVED] Format MySQL DATETIME

  1. #1

    Thread Starter
    "Digital Revolution"
    Join Date
    Mar 2005
    Posts
    4,471

    Resolved [RESOLVED] Format MySQL DATETIME

    Edit: Sorry, stupid mistake on my part. Got it resolved.

    Here's what I got:

    PHP Code:
    //Where I get the database entry into a variable.
    $data mysql_fetch_array($resultsMYSQL_ASSOC);

    //Format with strtotime.
    $entry_date strtotime($data['date']);

    //Format with date.
    $entry_time date("l, jS F, Y h:i:s a"$entry_date);

    //Displaying.
    echo '<h3>' $data['title'] . ' (' $entry_time ')</h3>'
    Last edited by DigiRev; Apr 2nd, 2007 at 06:17 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width