Can't handle date problem.

Posted on 2003-12-02
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?
Question by:luthorX
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Author Comment

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.

Author Comment

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.
LVL 20

Expert Comment

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

Technology Partners: 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!

LVL 84

Expert Comment

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]
LVL 20

Expert Comment

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.


EE Cleanup Volunteer

Accepted Solution

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

E-E Admin

Featured Post

Independent Software Vendors: 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

Suggested Solutions

Title # Comments Views Activity
PERL export multiple query results to a JSON file 1 178
Perl Awk Need Help 3 139
Formatting stings with pack and printf in perl 5 79
Perl File::Find alternative 1 87
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
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 (…
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…

726 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