Solved

Can't handle date problem.

Posted on 2003-12-02
6
512 Views
Last Modified: 2007-12-19
I have absolutely no experience with perl and I have been asked as a last resort to determine why part of the administration of a web site has fallen over.

The error I get is:
Can't handle date (0, 0, 0, 0, 12, 103) at e:\inetpub\vs159156\cgi-bin\fr_shop.plx line 63

The actual line in the code is:
my $endTime = timegm_nocheck (0,0,0,0,1+(gmtime)[4],(gmtime)[5]);

Now, I am not really sure what is wrong the date to make it not want to be able to handle it. I seems though that perhaps that 4th zero should not be there. Does anyone know?
0
Comment
Question by:luthorX
6 Comments
 

Author Comment

by:luthorX
ID: 9863743
Okay, it looks like the month is zero based. Meaning 11 is December and January 0. So 12 is out of bounds.

Looks like the previous coder was a little lazy try to get the next month.
0
 

Author Comment

by:luthorX
ID: 9863844
Problem Solvered.

I just added in a condition for when the month is December so that it just set the day to the 31st.
0
 
LVL 20

Expert Comment

by:jmcg
ID: 9863917
You seem to be doing very well for someone who has absolutely no experience with Perl!

Now that you've solved your problem yourself, you should go to Community Support (that's the CS button on the menu at the top of all Experts Exchange pages), click on Ask a Question, and post a message asking to delete this question and refund your points. Be sure to paste in a link to this question to make it easier for the moderators, but it can be as simple as

http:Q_20814677.html
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 84

Expert Comment

by:ozo
ID: 9864361
my $endTime = timegm_nocheck (0,0,0,0,(1+(gmtime)[4])%12,(1+(gmtime)[4])/12+(gmtime)[5]);
#but there's still a window when the month can tick over between calls to gmtime.  Better to read @g=gmtime; once, then do the arithmetic on $g[4], $g[5]
0
 
LVL 20

Expert Comment

by:jmcg
ID: 10218521
Nothing has happened on this question in more than 8 weeks. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
PAQ, refund points (asker posted their solution -- or accept answer by ozo).

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
ID: 10276576
PAQed, with points refunded (500)

Computer101
E-E Admin
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
A year or so back I was asked to have a play with MongoDB; within half an hour I had downloaded (http://www.mongodb.org/downloads),  installed and started the daemon, and had a console window open. After an hour or two of playing at the command …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now