mktime question

Discussion in 'PHP' started by bobby9101, May 30, 2007.

  1. #1
    Hi, I was wondering how I could get mktime to use the current hour, minute, and second but specify a day, month, and year
     
    bobby9101, May 30, 2007 IP
  2. bobby9101

    bobby9101 Peon

    Messages:
    3,292
    Likes Received:
    134
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I found a workaround using: mktime(date("H"), date("i"), date("s")...
     
    bobby9101, May 30, 2007 IP
  3. ansi

    ansi Well-Known Member

    Messages:
    1,483
    Likes Received:
    65
    Best Answers:
    0
    Trophy Points:
    100
    #3
    
    <?php
        $hms = explode(":",date("g:i:s",time()));
        $my_month = 07;
        echo date("F d Y g:i:sA", mktime($hms[0],$hms[1],$hms[2],$my_month,1,2007));
    ?>
    
    Code (markup):
     
    ansi, May 30, 2007 IP