[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Can't handle date problem.

Posted on 2003-12-02
6
Medium Priority
?
556 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 85

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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…
Six Sigma Control Plans
Suggested Courses

872 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