this has got me stumped, when this code runs i get this error
Month '-1' out of range 0..11 at /www/cgi-bin/libraries/Library.pm line 222\n
212 #------------------------------------------------
213 sub ConvertMysqlTime {
214 my $self = shift;
215 my ( $date , $lpszToUnixStamp ) = @_;
216
217 my @arDateTime = split ( / / , $date );
218 my @arDate = split ( /-/ , $arDateTime[ 0 ] );
219 my @arTime = split ( /:/ , $arDateTime[ 1 ] );
220 $arDate[ 1 ] =~ s/0^//g;
221
222 my $time = timelocal( $arTime[ 2 ] , $arTime[ 1 ] , $
+arTime[ 0 ] , $arDate[ 2 ] , $arDate[ 3 ] , $arDate[ 0 ] ) ;
223 if ( $lpszToUnixStamp eq "false" ) {
224 my ( $sec , $min , $hour , $mday , $month , $y
+ear , $wDay , $yDay , $isdst ) = localtime($time);
225
226 $year += 1900;
227 $time = $self->GetWeekDay( $wDay , "Long" ) .
+" " . $self->GetMonth( $month , "Long") . " $mday, $year";
228 }
229
230 return $time;
231 }
232
it ran just fine under perl 5.8 the error only started occuring when i tried to run it on 5.10
Thanks
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.