Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Subtracting and Comparing Two Dates

by BaldPenguin (Friar)
on Jan 08, 2007 at 23:03 UTC ( [id://593643]=note: print w/replies, xml ) Need Help??


in reply to Re: Subtracting and Comparing Two Dates
in thread Subtracting and Comparing Two Dates

For my own clarification, what benefits are there to using Time::Local instead of POSIX. The functionality seems to be the same. Is implemetation different? Or is it just a preference thing?

Don
WHITEPAGES.COM | INC
Everything I've learned in life can be summed up in a small perl script!
  • Comment on Re^2: Subtracting and Comparing Two Dates

Replies are listed 'Best First'.
Re^3: Subtracting and Comparing Two Dates
by ikegami (Patriarch) on Jan 08, 2007 at 23:11 UTC
    I don't see anything in POSIX similar to Time::Local's timegm. To which POSIX function were you refering?
      timegm() in Time::Local == gmtime() in POSIX

      After looking it looks like Time::Local is a Pure Perl interface to the Perl localtime objects where POSIX is an XS interface to the system libraries.

      Don
      WHITEPAGES.COM | INC
      Everything I've learned in life can be summed up in a small perl script!

        Not at all. Look at the arguments...

        FunctionPOSIX equivalentPurpose of Function
        CORE::gmtimePOSIX::gmtimeReturns GMT time components from epoch time.
        Time::Local::timegm[none]Returns the epoch time from GMT time components.
        CORE::localtimePOSIX::localtimeReturns local time components from epoch time.
        Time::Local::timelocalPOSIX::mktimeReturns the epoch time from local time components.

        POSIX is missing the very function that's needed here.

        I'm not sure that's quite right...

        sub gmtime { usage "gmtime(time)" if @_ != 1; CORE::gmtime($_[0]); }
        verses

        They seem to be different by a kilobyte or two. I noticed they both use CORE::gmtime() though.

        -Paul

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://593643]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (3)
As of 2024-04-26 04:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found