PDA

View Full Version : time...



lankinator
10-06-2007, 08:54 PM
hey,

how would you go about making a php script that does a certain thing if the times is between 2am and 3am?

all help appreciated

djr33
10-06-2007, 10:18 PM
Date will return the hour if you use the right format.
http://www.php.net/manual/en/function.date.php


<?php
$h = date('G');
if ($h==2) {
dostuff();
}
?>
Or, if you need a bigger timeframe:
if ($h>2&&$h<12)
etc.