SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot zeeshan's Avatar
    Join Date
    Mar 2001
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to get the date in php?

    Hi all,

    What is the function in php to get the current date (time not important). I need to insert this in every new record created, so that another script (executed by a cron job) can go through the table and delete all records that are over a week old.

    Thanks a bunch.

  2. #2
    PHP warrior dkode's Avatar
    Join Date
    Sep 2001
    Location
    Planet Namek
    Posts
    329
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://www.php.net/manual/en/function.date.php

    there is the link to the php.net date function

    gives you all the info you need.
    "Mankind cannot define memory, yet it defines mankind"
    -- Project 2501, Ghost in the Shell

    Smarty | PEAR | PHP Manual | MySQL Manual

  3. #3
    SitePoint Zealot zeeshan's Avatar
    Join Date
    Mar 2001
    Posts
    123
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks bud!

    p.s. The link you sent me had some good info. in the botes regarding finding date differences (i.e. number of days elapsed since...). This will help me a lot. Thanks.


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
  •