Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I want to get the day of the week (in word format) like my $time = localtime; does.
Using the example from the docs on localtime
It produces it in numeric form instead of saying Tue for tuesday.my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
My first question is why would saving it as a variable $time make it in text when breaking it apart put it into numerics?
Second question is, is the only way to convert the time so I can get the word day of the week the following?
I don't see why that'd be the only quick way to do it when it prints the days of the week if you first save it all to a variable.if ($wkday = 0) {$day = "Sun";} elsif ($wkday = 1) {$day = "Mon";}
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: getting day of the week
by moot (Chaplain) on Feb 01, 2005 at 22:02 UTC | |
Re: getting day of the week
by bradcathey (Prior) on Feb 01, 2005 at 22:04 UTC | |
Re: getting day of the week
by Roy Johnson (Monsignor) on Feb 01, 2005 at 23:52 UTC | |
by gellyfish (Monsignor) on Feb 02, 2005 at 10:27 UTC | |
Re: getting day of the week
by !1 (Hermit) on Feb 01, 2005 at 22:51 UTC | |
Re: getting day of the week
by bgreenlee (Friar) on Feb 01, 2005 at 22:09 UTC | |
Re: getting day of the week
by sh1tn (Priest) on Feb 01, 2005 at 22:09 UTC | |
Re: getting day of the week
by dragonchild (Archbishop) on Feb 02, 2005 at 03:27 UTC | |
Re: getting day of the week
by chanakya (Friar) on Feb 02, 2005 at 06:24 UTC |
Back to
Seekers of Perl Wisdom