Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Diff'ing dates

by ikegami (Patriarch)
on Oct 02, 2007 at 14:50 UTC ( [id://642122]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Diff'ing dates
in thread Diff'ing dates (solved)

The exit code can be controled as follows:

END { exit 1+($epochs[0] <=> $epochs[1]) }
0: first time is earlier 1: both times are the same 2: second time is earlier
perl -MTime::Local -lane'END{exit 1+($d<=>0)}$F[1]--;$d+=($.*2-3)*time +local@F[5,4,3,2,1,6]'

Replies are listed 'Best First'.
Re^4: Diff'ing dates
by LighthouseJ (Sexton) on Oct 02, 2007 at 15:30 UTC
    Oh, I'm not interested in which is earlier, I know the second one will always be later (or the same) than the first. I'm more interested in the actual value of the difference but I can handle that easily enough.
    "The three principal virtues of a programmer are Laziness, Impatience, and Hubris. See the Camel Book for why." -- `man perl`

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2025-05-14 06:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.