Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: perl basic count days between two dates

by dasgar (Curate)
on Oct 02, 2013 at 22:34 UTC ( #1056687=note: print w/replies, xml ) Need Help??

in reply to perl basic count days between two dates

For this kind of task, I personally would just use Date::Calc.

If you really want to write your own code, you might want to check out Dave Rolsky's Date, Times, Perl, and You presentation from YAPC::NA 2012. He discusses a lot of the challenges that one needs to keep in mind when dealing with dates and times (time zones, daylight savings time, leap seconds, etc.). If you're just doing this as a learning exercise, you might be willing to ignore some of the issues that Dave discusses in his presentation. However, if you're trying to create production code, you might want to consider leveraging the large amount of work others have put into the existing date and time modules.

  • Comment on Re: perl basic count days between two dates

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1056687]
[ambrus]: MLX: if it's a work email, then it's probably not Uncle Sam that matters, but what the account managing server at work thinks your name is. Those can differ. For example, we've had two co-workers with identical real name at one point,
[ambrus]: so one got a stupid suffix in the email account (people have email address based on their real name here usually).

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (14)
As of 2017-01-19 14:05 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (170 votes). Check out past polls.