This cgi script is for displaying the current date and time site.It's very simple one as
  1. It will run the date command at machine and takes the current date .
  2. It will simply takes it's fields seprately.
  3. Print the fields in proper manner.
    So script is as follows:
 
 
 
#!/usr/bin/perl
$date=`date`;
chomp($date);
@array=split(/ /,$date);
@date=("$array[2]","-","$array[1]","-","$array[5]");
select(STDOUT);$|=1;
print "Content-type: text/html\n\n";
print "<li>Current date is ",@date,"</li>";
print "<li>Current Time is ",$array[3],"</li>";
print "<li>Today is ",$array[0],"</li>";

Back