Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Counting the days from year 1900 to current

by CheeseLord (Deacon)
on Aug 11, 2001 at 00:16 UTC ( [id://104034]=note: print w/replies, xml ) Need Help??


in reply to Counting the days from year 1900 to current

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

Replies are listed 'Best First'.
Re: Counting the days from year 1900 to current
by CubeDweller (Initiate) on Aug 11, 2001 at 00:24 UTC
    That's great.

    You Guys are Great!!
    I am running on win32 version. How do I install the module? I've never done that before.

    Thanks in advance.
    CubeDweller
      Are you running cygwin or Activestate? With Activestate you can use the 'ppm' tool to install modules. With Cygwin I think you would want to download the tar ball and run the make; make install; but I haven't worked much with Cygwin's perl.

      Ira,

      "So... What do all these little arrows mean?"
      ~unknown

      if the modules isn't in activestate's archive, you'll need to find a copy of nmake.exe from microsoft to be able to create the makefile. do a web search and you should be able to come up with a copy. you'll also need to come up with a gcc-compatible compiler ... cygwin works and you can also download a kit that includes a compiler from borland. it's been a while since i worked through this, but you shouldn't have much trouble.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://104034]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-26 08:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found