SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Sep 2009
    Posts
    18
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    date, time + a few hours...

    PHP 5.2.6

    Hi.. I need to insert a time into an MySQL DB. It needs to be done by the php, as opposed to the database doing the maths...

    What is the best way to insert a "now + 24 hrs" etc into a db, I just need the value, not the SQL Statement..

    Thanks

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    PHP Code:
    <?php
    echo date(
        
    DATE_ISO8601,
        
    strtotime('+1 day')
    );    
    #2009-09-11T14:04:24+0000
    ?>
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.


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
  •