P is for Practical | |
PerlMonks |
Re: Counting the days from year 1900 to currentby CheeseLord (Deacon) |
on Aug 11, 2001 at 00:16 UTC ( [id://104034]=note: print w/replies, xml ) | Need Help?? |
This looks like a job for Date::Calc! (Available from your nearest neighborhood CPAN.) In all seriousness, though, you'll notice that you're not calculating leap days, and other annoying things that time has to deal with, which is why I recommend using the module. That said, the problem is likely in your assignment: yday is two fields after year, not one (it's at (localtime)[7]). Check out localtime for more info. Update: Added link to Date::Calc. His Royal Cheeziness
In Section
Seekers of Perl Wisdom
|
|