Hello All,
I sorry to be asking this but i have wasted lots of time
Trying to do this alone. I have gone over and over the examples on the Date & Time questions but I think I’m
Missing the point some ware

When using the below code its fine until i try and find the time difference between the minutes.

I’m running this on activestate perl. which gives the error of

Can't locate object method "min" via package "Time::Seconds" (perhaps to load "Time::Seconds"?) at
C:\Inetpub\GMN542\timetest.pl line 19.

Normally if i had this error on Unix i guess the perl module
was not installed but i have looked on my windows box and I found that I do have

C:\Perl\site\lib\Time\Piece.pm
and
C:\Perl\site\lib\Time\Seconds.pm
So is this just an error with the way im trying to query the
minute strings?

I guess the question is have I got a problem with my installation of the perl modules?
Or
Is it due to the wrong variable name used for minute? I think I have tried “minute” and “min”.

Again as ever any help that anybody can offer is more then appreciated

regards
Gareth

#!/usr/bin/perl use Time::Piece; use Time::Seconds; $before = Time::Piece->strptime("2003/04/30 10:00:00", "%Y/%m/%d %H:%M +:%S"); $now = localtime(time); $diff = $now - $before; $years = int($diff->years); $diff -= $years * ONE_YEAR; $months = int($diff->months); $diff -= $months * ONE_MONTH; $days = int($diff->days); $diff -= $hours * ONE_HOUR; $hours = int($diff->hours); $diff -= $min * ONE_MIN; $min = int($diff->min); print "$years years, $months months, $days days since , $hours hours s +ince, $min min since $before\n";

In reply to Time::Piece errors? by spacey

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.