#!/usr/bin/perl -wT
use CGI':standard';
use strict;
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
my @srv_time;
my @gmt;
my $element;
my $utc;
my $servertime;
@srv_time = localtime();
@gmt = gmtime();
print "Content-type: text/html\n\n";
print "<!DOCTYPE html>";
print "<html><head><title>Day and Time Functions</title></head>";
print "<body>";
print "<div style='font-family:monospace;color:#000000;white-space:pre;font-size:26px;'>Sec Min Hr Date Mth Yr Wkd Yrd DST</div>";
print "<div style='font-family:monospace;color:#0000cc;white-space:pre;font-size:26px;'>";
foreach $element (@srv_time)
{
print "$element ";
}
print "==> Server Time</div>";
print "<div style='font-family:monospace;color:#006600;white-space:pre;font-size:26px;'>";
foreach $element (@gmt)
{
print "$element ";
}
print "==> Greenwich Mean Time</div>";
$servertime = localtime();
print "<div style='color:#cc0000;font-size:36px;margin-top:12px;'>Current Server Time: ";
print $servertime;
print "</div>";
$utc = gmtime();
print "<div style='color:#cc0000;font-size:36px;margin-top:12px;'>Current GMT: ";
print $utc;
print "</div>";
print "</body></html>";
Day and Time FunctionsSec Min Hr Date Mth Yr Wkd Yrd DST
22 12 3 29 2 124 5 88 1 ==> Server Time
22 12 8 29 2 124 5 88 0 ==> Greenwich Mean Time
Current Server Time: Fri Mar 29 03:12:22 2024
Current GMT: Fri Mar 29 08:12:22 2024
COPYRIGHT © 2015-2024 IHYPRESS.NET. A DIVISION OF IHY PRESS. ALL RIGHTS RESERVED.