Or use Date::Format; and say time2str("%A",$time);
You did want Saturday, right?
Update: I got ahead of myself. time2str
uses a epoch time which you could get from timelocal. Turns
out, I should have used strftime("%A", ['','','',25,05,2002]);
ALL HAIL BRAK!!! | [reply] [d/l] [select] |
Um, what do I do for that localtime() part??
Or Psycho, what does $time hold?
Could you give me the code, I'm slow.
Update: Hey, isn't the Date module standard??
I have to install the stupid thing... Unbelievable! | [reply] |
While I strongly suggest taking cat2014's advice... The localtime function converts an Epoch date into a list. If you look at the documentation, it has (IIRC) nine elements, of which one is the number of the day of the week ($wday). Which you can then use to extract the day of the week from your own @days = ( Sun, Mon, Tue, Wed, Thu, Fri, Sat) list, using $days[$wday]. Update: Getting your input date into Epoch time without a module like Date::Manip, however, is tricky as all heck and not recommended.
| [reply] [d/l] |