Use DateTime.
#!/usr/bin/env perl use 5.012; use warnings; use DateTime; my $dt = DateTime->new(year => 2002, month => 2, day => 21); say "I'm pretty sure it was a " . $dt->day_name; say "Today is " . DateTime->now()->day_name;
Output:
I'm pretty sure it was a Thursday Today is Monday
If that output is not to your liking, look at the many methods in DateTime for more options such as numeric or abbreviated weekdays.
In reply to Re: Get day of week from current date
by rjt
in thread Get day of week from current date
by gavrilo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |