date function problem



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.

Thanks in advance
Jackal Hunt

.



Relevant Pages

  • Re: date function problem
    ... Sorry for posting my query in this group as i was not aware of any ... echo "Good afternoon"; ... Please suggest me any newbie PHP groups. ...
    (comp.lang.php)
  • Re: Running Update Macro disables switchboard
    ... Turning the echo back on at the end of the script returned the same result. ... The reports have products & pricing and are sent out monthly - about a week ... Regular prices don't change that often, but sale prices go on and off. ... I delete the old query as the new one will ask for a different 'sale price' ...
    (microsoft.public.access.macros)
  • Re: Tough Analytical SQL Question
    ... for each ctype and order_date, ... CTYPE = 'ECHO' ... (PARTITION BY ctype_id ORDER BY order_date RANGE 7 PRECEDING) ... The results of the inner query starting with "SELECT DISTINCT ...
    (comp.databases.oracle.server)
  • Re: Tough Analytical SQL Question
    ... for each ctype and order_date, ... CTYPE = 'ECHO' ... (PARTITION BY ctype_id ORDER BY order_date RANGE 7 PRECEDING) ... The results of the inner query starting with "SELECT DISTINCT ...
    (comp.databases.oracle.server)
  • PDO: Debugging prepared statements
    ... function that also provided some debugging support to echo the query ... Being able to echo back SQL statements as they are being ... Prepared Statements don't work the way doing queries the traditional ... I can't echo the query being ...
    (comp.lang.php)