Hi All, Hopefully someone will have a quick info to this. I am trying to figure out how many days it has been since Jan 1, 1968 using the timelocal function. I can figure out how many days it is between Jan 1, 1968 to whatever date the epoch is in perl (I'll just hardcode the difference in the script then and add to the number I retrieve from timelocal afterwards). I have a function created to accept 2 dates and find out how many days are between the 2 dates. When I pass in the parameters to the timelocal function to get how many seconds from Jan 1, 1970 is Jan 1, 1970 I was hoping to get 0 but instead I get 18000. What parameters do I need to pass in to get 0 seconds back (this will be a generic function so I want to pass in the values I need to get 0). Also when I run the timelocal function with some other parameters I have I was hoping to get a whole number back for when I get a number from timelocal and then divide by 60*60*24. I've tried using 0 for seconds, minutes, and hours and the proper day, month, and year but I keep getting numbers that give decimals after dividing by 60*60*24. Any help would be greatly appreciated. Rob

In reply to Using timelocal function by rpike

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.