Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

concverting/extracting day of week from entered date

Status
Not open for further replies.

calabama

Programmer
Feb 19, 2001
180
0
0
US
Greetings,

I have (3) pulldown menus. Month, Date and Year. I need to convert the user selections from these pulldowns to the coresponding day of the week.

What would be the best way to do that?

Thanks

Cal
 
Code:
use Time::Local;
use Time::localtime;

# check CGI params here: they can be easily forged

my $time = timelocal( 0, 0, 12,
                   param('day_of_month'),
                   param('month')-1,
                   param('year')
                  );
my $DoW = localtime( $time )->wday; # 0=Sun

I hope that this helps,


yours,


fish

"As soon as we started programming, we found to our surprise that it wasn't as easy to get programs right as we had thought. Debugging had to be discovered. I can remember the exact instant when I realized that a large part of my life from then on was going to be spent in finding mistakes in my own programs."
--Maurice Wilk
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top