Forum Moderators: coopster & phranque

Message Too Old, No Replies

CGI/Perl Date Functions

not sure how to do this...

         

newnewbie1

7:27 am on Mar 9, 2003 (gmt 0)

10+ Year Member



What I'd like to do is this...

1) Get current Date.
2) Format drop down menu with Mon-Fri dates for the next month out. I don't want to show weekend dates. I want the dropdown date to be formatted as such:

<option value="Mar. 11th - Tue">Mar. 11th - Tue</option>

Can this be done with CGI/Perl?

dingman

7:46 am on Mar 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What you propose is certainly do-able. If you want to use Perl, then the Time and Date modules are a good place to look for functions that will help.

aaronc

8:23 pm on Mar 11, 2003 (gmt 0)

10+ Year Member



localtime should give you all the variables you need.
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();

You just have to write a couple of loops.
If you want specific code examples, I can write up something..