in reply to (Ovid) Re: Getting Day Of Month
in thread Getting Day Of Month
An alternative to Date::Manip is the Date::Calc module which also provides hordes of date utility functions (and it is a C lib so it is fairly quick).
#!/usr/bin/perl -w use strict; use Date::Calc qw/Day_of_Week/; my @days = qw/Sunday Monday Tuesday Wednesday Thursday Friday Saturday/; my $dow = $days[ Day_of_Week(2002, 5, 25) ]; print "$dow\n"; __END__
Several have mentioned simple ways to do it yourself, but if you need more date manipulation than your post suggests (things like differences between dates, business days, etc), I recommend checking out one of the modules -- it isn't hard to work with dates, but it isn't hard to work with dates incorrectly either :-)
|
|---|