in reply to Day of week for an arbitary date using core modules

The new Time::Piece interface works very well for this... (though its a "future core module" rather than a current one)
#!/usr/bin/perl -wT use strict; use Time::Piece; my ($year, $month, $day) = qw(2002 02 21); my $t = Time::Piece->strptime("$year/$month/$day", "%Y/%m/%d"); print "day of week is " . $t->day_of_week . "\n"; print "day of week is " . $t->day . "\n";

-Blake

Replies are listed 'Best First'.
Re: Re: Day of week for an arbitary date using core modules
by davorg (Chancellor) on Feb 22, 2002 at 07:22 UTC

    Last I read, Time::Piece wasn't going to be added to the core. Don't know why, but it's a shame because it's a fine module.

    --
    <http://www.dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg