#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Location
    Australia
    Posts
    4
    Rep Power
    0
    I get the todays date- yesterdays date and tomorrows date, like so:

    $yesterday = date ("Y-m-d", mktime (0,0,0,date("m"),(date("d")-1),date("Y")));

    $tomorrow = date ("Y-m-d", mktime (0,0,0,date("m"),(date("d")+1),date("Y")));

    $actualdate = date("Y-m-d");

    Which returns the date in the format "200-11-13"

    But I need to add 13 hours to all three - how owuld I do this?
  2. #2
  3. Banned (not really)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 1999
    Location
    Brussels, Belgium
    Posts
    14,648
    Rep Power
    4493
    just use date("h")+13 in the hours section of mktime.

    $tomorrow = date ("Y-m-d", mktime (date("h")+13,0,0,date("m"),(date("d")+1),date("Y")));

    I think "h" is for hours, correct me if I'm wrong.

    Also, something to point out. If this line executes right at midnight, and half of the date calls are in one day, the the other half in the next day...that'll mess things up, probably. sure, small occurance, but you should plan for everything. even thought it's midnight there, that'll be the time when you biggest client in Asia looks at the page and it breaks....

    thought i'd share...

    ---John Holmes...

Similar Threads

  1. DATE_ADD question where date YYYYMMDD
    By lottos in forum PHP Development
    Replies: 5
    Last Post: February 22nd, 2004, 08:53 PM
  2. PHP MySQL question
    By spookymark in forum PHP Development
    Replies: 1
    Last Post: February 17th, 2004, 01:07 AM
  3. PHP and Table Relationship question
    By spank in forum PHP Development
    Replies: 4
    Last Post: February 9th, 2004, 09:24 PM
  4. SSL & PHP together question?
    By asedesigns in forum Apache Development
    Replies: 1
    Last Post: February 7th, 2004, 10:35 PM
  5. Php + Flash Question
    By ORANGE900 in forum PHP Development
    Replies: 0
    Last Post: January 23rd, 2004, 02:23 AM

IMN logo majestic logo threadwatch logo seochat tools logo