get the week day of a date?

R

robertchen117

my date format is "030207", 03/02/2007, how could I get it is Friday?

Thanks, too tricky for me and beyond my mind.
 
M

Mumia W.

my date format is "030207", 03/02/2007, how could I get it is Friday?

Thanks, too tricky for me and beyond my mind.

You can use the strftime function from the POSIX module.
 
M

Mumia W.

You can use the strftime function from the POSIX module.

Here's a short example:

require POSIX;
import POSIX qw(strftime);

my $string = '030207';
my @date = $string =~ /../g;
$date[2] += 100;
$date[0] -= 1;

print strftime('%F (%A)',0,0,0,@date[1,0,2]), "\n";
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top