If I had a timestamp from 3 days ago at 4:31 pm, and one from 9 days ago at 2:40am, what kind of command would tell me the amount of days between there, not hours, minutes or anything like that, just complete days??
For example:
my $_timestamp1 = '1189669351';
my $_timestamp2 = '1189395751';
my $_timebetween = $_timestamp1 - $_timestamp2;
# $_timebetween now has 273600 which if I do (273600 / (60 * 60 * 24)
+it is 3.1666666666666666666666666666667
So should I just do that and erase everything to the right of the period? Or is there a module that will make it more simple, or any code?
Thank you.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.