| 20010: Y2K bug redux? (...or bug in Y2K fix?) |
Pfui

msg:4053983 | 9:00 pm on Jan 4, 2010 (gmt 0) | This more-novice-than-not Perl fan uses a message board script that I've tweaked and updated to a fare thee well since 1997. A Y2K fix took care of that date problem, but now I have a new one -- posts dated akin to: Monday, 4 January 20010, at 9:53 a.m. Thinking all I needed to do was tweak the Y2K fix (probably my first of many mistakes), I did. And now I've re-re-re-tweaked enough times that I'm about to get my all-unsuccessful test versions mixed up to a fare thee well, too. Anyway. The original Y2K fix has three parts, placed in different parts of the .pl file, this one -- if ($year > 99) { $year = $year-100; }
-- and this: $todaydate = "$days[$wday], $mday $months[$mon] 200$year, "; $todaydate = $todaydate."at $hour\:$min $ampm"; }
-- and this: $StartYear = $FORM{'EndYear'}-2000; $EndYear = $FORM{'StartYear'}-2000;
I tried swapping 201$year (and 20$year, and 2$year, and $year) for 200$year, and 2010 for 2000. Nothing changed. Ditto these found somewhere/cobbled together additions: if ($year eq 10) { $year = "$year"; } if ($year < 10) { $year = "0$year"; }
Thoughts, please? Again, clearly I'm not a Perl maven:) Also, apologies if the preceding snippets are insufficient to help troubleshoot the snafu. Any/all assistance will be appreciated, thank you!
|
Pfui

msg:4054808 | 10:24 pm on Jan 5, 2010 (gmt 0) | And now, from the "Hindsight is 20/20" Department -- After staring at the program for too many hours, the only in-use part of the original Y2K fix that needed fixing was: $todaydate = "$days[$wday], $mday $months[$mon] [b]200[/b]$year, ";
And the solution? $todaydate = "$days[$wday], $mday $months[$mon] [b]20[/b]$year, ";
Darned if I didn't test that exact tweak early on, and l_o_n_g before posting here on this board. But -- I forgot to test each tweak via a new post on my board. I just kept reloading the index thinking the wrongly-dated posts would change, completely blanking out that those files were already written to disk. (slaps head) So-o-o, to quote Gilda Radner's quirkily wonderful Emily Litella on SNL, "Never mind. [en.wikipedia.org]" :)
|
|
|