Page 1 of 1

time checking

Posted: Tue Aug 28, 2007 2:49 am
by itsmani1
Hello

I want to check if time is beween 28th august 2007 12:12:12 and 28th august 2007 12:18:12

any help
thanks

Posted: Tue Aug 28, 2007 4:23 am
by volka
strtotime is your friend

Code: Select all

<?php
$s = strtotime('28th august 2007 12:12:12');
$e = strtotime('28th august 2007 12:18:12');

$now = time();

if ( $now>=$s && $now<=$e ) {
	echo '+';
}
else {
	echo '-';
}