What's wrong with multiplying by 86400?
If you need to have a module do it, take a look at DateTime, Date::Calc and Date::Manip.
Being right, does not endow the right to be rude; politeness costs nothing. Being unknowing, is not the same as being stupid. Expressing a contrary opinion, whether to the individual or the group, is more often a sign of deeper thought than of cantankerous belligerence. Do not mistake your goals as the only goals; your opinion as the only opinion; your confidence as correctness. Saying you know better is not the same as explaining you know better.
I shouldn't have to say this, but any code, unless otherwise stated, is untested
| [reply] |
If you mean "convert a day ... to seconds since the epoch", you can try the Time::Local module, which I believe is part of the perl core distribution.
If you don't know what "seconds since the epoch" refers to, then I'm simply guessing wrong about what your question really means, and you should just ignore me and pay attention to the previous replies.
There are lots of CPAN modules in the "Date::" family, and some of them are pretty awe-inspiring (or overwhelming, depending on your nature). If you're doing arithmetic involving dates, you're bound to find a Date:: module that suits you. (But you can do quite a lot with just Time::Local, as well.) | [reply] |
graff,
Thanks for your input. I was not clear in my question. I was simply searching for the number of days * the number of seconds in a day.
T.
| [reply] |
Yes, the calculation is simple if you're only working with days:
$days = 2; # (or any other number)
$seconds = $days * 24 * 60 * 60;
| [reply] [d/l] |
I used the calculation, but only used $days = $seconds * 86400. This seemed to work - am I wrong? I am just starting out in Perl, so I am probably totally confused!
Thanks,
Ms. T.
| [reply] |