Re: date function problem
- From: Gilles FEVRIER <g-fevrier@xxxxxxxxxx>
- Date: Tue, 28 Nov 2006 14:01:35 +0100
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
.
- References:
- date function problem
- From: jackal_work
- date function problem
- Prev by Date: date function problem
- Next by Date: Re: PHP plug-in dont work in Eclipse?
- Previous by thread: date function problem
- Next by thread: php form help
- Index(es):