programming-examples/perl/Datatype/Print out the current time in standard time.pl

12 lines
374 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/local/bin/perl -w
my $time = time;
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime ($time);
my $newtime = $time - ($isdst * 3600);
my $stdtime = localtime ($newtime);
my $daytime = localtime ($time);
print "The current daylight time is: $daytime\n";
print "The current standard time is: $stdtime\n";