SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    May 2004
    Location
    Avon
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Displaying Time and Date In Blog Header

    In my header for my blog I'd like to make it so it displays the time and date that the post is posted. How can I do this? I know NOTHING about PHP but I know XHTML and CSS, so bare with me. Thanks in advance!

  2. #2
    SitePoint Wizard Sillysoft's Avatar
    Join Date
    May 2002
    Location
    United States :)
    Posts
    1,691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well depends, if just the current date/time:

    PHP Code:
    $date date('m/d/y g:ia'); 
    There are more extensive ways to show it like full month name and what day of the week. But thats a basic one that will show in format:

    mm/dd/yy h:mmpm

    Robert

  3. #3
    SitePoint Zealot
    Join Date
    May 2004
    Location
    Avon
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?php echo date("F j, Y | g:i a"); ?>
    I think that's what I want...For example I want it so say January 18th, 2005 | 6:17 PM

  4. #4
    SitePoint Wizard Sillysoft's Avatar
    Join Date
    May 2002
    Location
    United States :)
    Posts
    1,691
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Then you answered your question. Give yourself some rep

    Silly


Bookmarks

Posting Permissions

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