Results 1 to 3 of 3

Thread: PHP : Converting MySQL DateTime format to 'Monday, 4 feb 2002'

  1. #1

    Thread Starter
    Fanatic Member SkiNLaB's Avatar
    Join Date
    Jan 2002
    Location
    Sydney, Australia
    Posts
    747

    PHP : Converting MySQL DateTime format to 'Monday, 4 feb 2002'

    There's gotta be a function out there to convert the MySQL DateTime format to something like 'Monday, 4 feb 2002' for eg, or similar...

    Thanx

  2. #2
    scoutt
    Guest
    well you can try this

    getdate(timestamp); // returns an associative array with date/time settings for the specified timestamp

    other than that I would store the date using date(l j M Y);
    'Monday, 4 feb 2002'

    $today = date("l, j M Y"); // Saturday 10 Mar 2002

    l = lowercase L

  3. #3

    Thread Starter
    Fanatic Member SkiNLaB's Avatar
    Join Date
    Jan 2002
    Location
    Sydney, Australia
    Posts
    747
    $new_date = date["l' j N Y, G:i:s", strtotime[$date_time]];
    echo "$new_date";

    the original string in mysql format was date_time

    this seems to do the trick.

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