#!/usr/bin/env python3
###################################################################################
# Python date functions 
# checking the hour of the day
###################################################################################
from datetime import datetime

print("Content-Type: text/html \n")     #http header with newline char (required for the web)
print('<pre>')                          #to produce better display on the web 

now  = datetime.now( )                          #get current date and time
hour = now.hour                                 #get the hour component

if hour < 12 :
    print("Good Morning.")                      #print it on the HTML page
elif hour < 20 :
    print("Good Afternoon.")           
else :
    print("Good Evening.")             

print(" The current date and time is: ", end='')   
print(now)                                      #print date and time