Greetings $hour = date( "G" ); $now = date( "g:i a" ); $msg = "Good Evening."; if( $hour < 18 ) { $msg = "Good Afternoon."; } if( $hour < 12 ) { $msg = "Good Morning."; } echo( "$msg The time is $now" ); ?>