http://qs321.pair.com?node_id=33994

neophyte has asked for the wisdom of the Perl Monks concerning the following question: (dates and times)

This is the code I have been using for a while:
sub zeit { my $wtag = ("Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", + "Freitag", "Samstag")[(localtime)[6]]; my $mtag = sprintf("%02d", (localtime)[3]); my $monat = ("Januar"," Februar", "Maerz", "April"," Mai", "Juni", "Ju +li", "August", "September", "Oktober", "November", "Dezember")[(local +time)[4]]; my $jahr = (localtime)[5] + 1900; my $stunde = sprintf("%02d", (localtime)[2]); my $min = sprintf("%02d", (localtime)[1]); my $zeit = "$wtag, den $mtag\. $monat $jahr um $stunde\:$min Uhr"; return $zeit; }

It works fine for me, but I just wondered.

Originally posted as a Categorized Question.