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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Conversion Without Using Modules

Status
Not open for further replies.

lagerplease

Technical User
Dec 15, 2001
38
GB
I don't trust my ISP (they remove standard PERL modules for no reason) so I need to be able to convert a date to a different format without using Date::Calc or Date::Manip.

I have an input string of, say, "31/07/04" and I need to return "Sat Jul 31".

Any clever little tricks to do this quickly?
 
Why not put the module in your cgi-bin directory and call it locally? Create a new folder called 'modules' in your cgi-bin directory, give it the necessary permissions, and add this line near the top of your scripts:

use lib qw(<path_to_cgi-bin_folder>/cgi-bin/modules);

Add your modules to this directory and you won't have to worry about what your ISP does.

There's always a better way. The fun is trying to find it!
 
Well, you should easily be able to get the month. For the day of the week, look up something called the doomsday algorithm. You'll need to know if it's a leap year or not to use this, but that's pretty easy to calculate.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top