SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: date display

Hybrid View

  1. #1
    SitePoint Zealot zook's Avatar
    Join Date
    May 2001
    Location
    Houston, tx
    Posts
    134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    date display

    this may seem like an easy question, but i'm new to this, and i didn't find any predefined variables for the date in the php.net documentation.

    anybody know if there is a predefined variable for the date? if not...how would one display the current date on the server

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You would use the date() function.

    http://www.php.net/date

    PHP Code:
    $var date("Y-m-d");
    print 
    $var//prints 2001-09-24

    $var date("Y-m-d"$timestamp);
    print 
    $var//prints the same according to a unix timestamp.


    //See the link above for all the possible formatting options. 
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


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
  •