Re: date function problem



Hello,

> jackal_work@xxxxxxxxx a écrit :
Hi group,
Sorry for posting my query in this group as i was not aware of any
newbie PHP groups around. My code looks like this:
-----------------------------------------------------------------------------------------------------------------------
<?php

$hour = date("H");
if ($hour < 12) {
echo "Good morning";
}
elseif ($hour < 17) {
echo "Good afternoon";
}
else {
echo "Good evening";
}
echo $hour;

?>
-----------------------------------------------------------------------------------------------------------------------

The last line of this code always displays 12 when it should display
the actual hour. Please suggest me any newbie PHP groups.


It works well when I tried it (it display "14"). :-)

Gilles
.