Solved

Can't handle date problem.

Posted on 2003-12-02
6
522 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Perl script to parse log and delete the file 17 172
Perl Sort Question 4 129
perl CPAN issue 3 97
Move Function in Perl Script 2 65
I have been pestered over the years to produce and distribute regular data extracts, and often the request have explicitly requested the data be emailed as an Excel attachement; specifically Excel, as it appears: CSV files confuse (no Red or Green h…
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…
This is a video that shows how the OnPage alerts system integrates into ConnectWise, how a trigger is set, how a page is sent via the trigger, and how the SENT, DELIVERED, READ & REPLIED receipts get entered into the internal tab of the ConnectWise …

914 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

21 Experts available now in Live!

Get 1:1 Help Now