#!/usr/local/bin/perl # Script: Window of Time # Author (used loosely): Amy Stone # Version: .02 # Last modified: 5/2/98 # # This script determines which "Time" image to display on # the web page, based on the time of day. Obviously, this # is very basic, as it does not take into account how # seasons affect the length of the day. Oh, well. I'm # a designer--not a programmer! # ########################################################### ($second, $minute, $hour, $day_of_month, $month, $year, $weekday, $day_of_year, $daylight_standard_time)=localtime(time); if ( ($hour >= 6) && ($hour < 7) ) { print "Sunrise\n"; } if ( ($hour >= 7) && ($hour < 8) ) { print "Early Morning\n"; } if ( ($hour >= 8) && ($hour < 12) ) { print "Morning\n"; } if ( ($hour >= 12) && ($hour < 15) ) { print "Afternoon\n"; } if ( ($hour >= 15) && ($hour < 17) ) { print "Late Afternoon\n"; } if ( ($hour >= 17) && ($hour < 19) ) { print "Sunset\n"; } if ( ($hour >= 19) && ($hour < 20) ) { print "Dusk\n"; } if ( ($hour >= 20) && ($hour < 24) ) { print "Evening\n"; } if ( ($hour >= 0) && ($hour < 4) ) { print "Night\n"; } if ( ($hour >= 4) && ($hour < 6) ) { print "Predawn\n"; }