PHP Date and Time

Discussion in 'PHP' started by saadi123, Sep 10, 2010.

  1. #1
    I want to display php date and time on my blog. But the problem is that php date and time functions always display current date & time, which is always dynamic. I want the historical date & time to be echoed. The date and time when an event happened. Like say for example, The post was published on "historical time and date" or this comment was posted on "historical time and date".

    Of course mysql is also going to come in here so any suggestions regarding both...???
     
    saadi123, Sep 10, 2010 IP
  2. viron86

    viron86 Active Member

    Messages:
    426
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    60
    #2
    while storing comment or post in database table you will need to add one more column for storing date and time while inserting you can use now() in mysql which will store the current date and time while the time of insertion and thus while displaying the comment or blog post you just need to select that respective column.
     
    viron86, Sep 10, 2010 IP