#!/usr/bin/perl use warnings; use strict; use CGI qw(:standard); print header, start_html; print "<center><H2>Important Neopets Times</H2></center>"; print "<br>"; my ($sec, $min, $hour) = localtime(time); print "The current server time is $hour:$min:$sec"; print "<table>"; print "<tr>"; # # Job time # print qq(<td width="15" bgcolor="gray">); print "Jobs"; print "</td>"; print "<td>"; if ($min <= 10) { my $newjobtime; $newjobtime = 10 - $min; print "There are <font color=blue>$newjobtime</font> minute(s) until j +obs are replenished."; print qq( <a href="http://www.neopets.com/faerieland/employ/employm +ent.phtml" target="new">get a job!); } elsif ($min <= 20) { my $newjobtime; $newjobtime = 20 - $min; print "There are <font color=blue>$newjobtime</font> minute(s) until j +obs are replenished."; print qq( <a href="http://www.neopets.com/faerieland/employ/employm +ent.phtml" target="new">get a job!</a>); } elsif ($min <= 30) { my $newjobtime; $newjobtime = 30 - $min; print "There are <font color=blue>$newjobtime</font> minute(s) until j +obs are replenished."; print qq(&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www +.neopets.com/faerieland/employ/employment.phtml" target="new">get a j +ob!</a>); } elsif ($min <= 40) { my $newjobtime; $newjobtime = 40 - $min; print "There are <font color=blue>$newjobtime</font> minute(s) until j +obs are replenished."; print qq( <a href="http://www.neopets.com/faerieland/employ/employm +ent.phtml" target="new">get a job!</a>); } elsif ($min <= 50) { my $newjobtime; $newjobtime = 50 - $min; print "There are <font color=blue>$newjobtime</font> minute(s) until j +obs are replenished."; print qq( <a href="http://www.neopets.com/faerieland/employ/employm +ent.phtml" target="new">get a job!</a>); } elsif ($min <= 60) { my $newjobtime; $newjobtime = 60 - $min; print "There are <font color=blue>$newjobtime</font> minute(s) until j +obs are replenished."; print qq( <a href="http://www.neopets.com/faerieland/employ/employm +ent.phtml" target="new">get a job!</a>); } print "</td>"; print "</tr>"; print "<tr>"; # # Snowager Time # print qq(<td width="15" bgcolor="gray">); print "Snowager"; print "</td>"; print "<td>"; my ($sec1, $min1, $hour1) = localtime(time); if ($hour1 = 1) { print qq(<font color=blue>The snowager is sleeping!</font>&nbsp;&nbsp; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb +sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://www.neopet +s.com/winter/snowager2.phtml" location="new">steal your keep!</a>); } elsif ($hour1 >= 1 && $hour1 > 9) { my $snowagertime; my $snowagertime2; $snowagertime = 9 - $hour1; $snowagertime2 = 60 - $min1; print "There are $snowagertime hours(s) and $snowagertime2 minute(s) l +eft until he awakens!"; } elsif ($hour1 = 9) { print qq(<font color=blue>The snowager is sleeping!</font>&nbsp;&nbsp; +&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://www.neopets.com/winter/snowa +ger2.phtml" location="new">Steal your keep!</a>); } elsif ($hour1 > 9 && $hour1 < 17) { my $snowagertime; my $snowagertime2; $snowagertime = 9 - $hour1; $snowagertime2 = 60 - $min1; print "There are $snowagertime hours(s) and $snowagertime2 minute(s) l +eft until he awakens!"; } elsif ($hour1 = 17) { print qq(<font color=blue>The snowager is sleeping!</font>&nbsp;&nbsp; +&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://www.neopets.com/winter/snowa +ger2.phtml" location="new">Steal your keep!</a>); } elsif ($hour1 > 17 && $hour1 < 24) { my $snowagertime; my $snowagertime2; $snowagertime = 24 - $hour1; $snowagertime2 = 60 - $min1; # calculate minutes to make hours match u +p print "There are $snowagertime hours(s) and $snowagertime2 minute(s) l +eft until he awakens!"; } elsif ($hour1 >= 24 && $hour > 1) { print qq(<font color=blue>The snowager is sleeping!</font>&nbsp;&nbsp; +&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://www.neopets.com/winter/snowa +ger2.phtml" location="new">Steal your keep!</a>);} print "</td>"; print "</tr>"; print "<tr>"; print qq(<td witdh="20" bgcolor="gray">); print "New Day"; print "</td><td>"; my ($sec2, $min2, $hour2) = localtime(time); if ($hour2 < 2) { my $newday; my $newday2; $newday = 2 - $hour2; $newday2 = 60 - $min2; print "There are $newday hour(s) and $newday2 minute(s) until the new +day."; print "</td>"; print "</tr>"; print "</table>"; print end_html; } elsif ($hour2 >= 2) { my $newday; my $newday2; $newday = 24 - $hour2; $newday2 = 60 - $min2; print "There are $newday hour(s) and $newday2 minute(s) until the new +day."; print "</td>"; print "</tr>"; print "</table>"; print end_html; }

In reply to Neopets Times by sulfericacid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.