in reply to Date to Day

Unlike Date::Calc, Time::Local comes with perl. Untested:
use Time::Local "timelocal"; my ($month, $mday, $year) = split /-/, "01-23-2004"; my $wday = (localtime(timelocal(0, 0, 0, $mday, $month-1, $year-1900)) +)[6];
But if you are doing much date work, it's worthwhile to learn how to use Date::Calc or DateTime.

Update: adjusted year and month to be localtimey. Thanks isotope.

Replies are listed 'Best First'.
Re^2: Date to Day
by isotope (Deacon) on Aug 25, 2004 at 22:18 UTC
    Watch those values there, ysth. The range for $month and the math for $year are the same as localtime().


    --isotope