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:
It works fine for me, but I just wondered.
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.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Is there a shorter way to create a german time string?⭐
by t0mas (Priest) on Sep 26, 2000 at 15:10 UTC | |
by neophyte (Curate) on Sep 26, 2000 at 20:13 UTC | |
Re: Is there a shorter way to create a german time string?
by Fastolfe (Vicar) on Nov 20, 2000 at 19:18 UTC |
Back to
Seekers of Perl Wisdom