How would i do an if statement for current time to display something? ( 3 Views )

no kitty!
  1. Ok title may not make much sense but here goes.
    I want to make text display between 6 and 8 pm, how would i make an if statement or whatever do that?

    (ibrahim, Faroe Islands)

  2. This isn't the exact code but you could try something like if current time is less than 8 pm and greater than 6 pm, echo this. I'll try to give you the code later.

    EDIT: It can also be done easily using javascript.

    (müşdeba , Myanmar)

  3. Try this.
    PHP Code:

    $h = date('H');
    if ((
    $h => 18) and ($h <= 20)) { echo 'It\'s time!'; }


    (kazım, Rwanda)



Related Topics ... (or search in 1.720.883 topics !)

how to display current time, with hundredths of a second? (10)
how do you display current date and time? (3)
display current time + 24 hrs (4)
display current date and time from uses computer (4)
display current time and date in text box (3)
adding an extension onto my current asp statement (6)
find time closest to current time from a set of variables (13)
compare time posted with current time not working (5)
how can i get current system time by functions time()? (2)




copyright © 2007-2031 Pfodere.COM ( 8 Pfoyihuee Online )

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 
1.1061