[TriLUG] a quickie perl question

Marc Wiatrowski mwia at iglass.net
Mon May 19 08:59:16 EDT 2008


On Fri, 2008-05-16 at 18:45 -0400, Greg Brown wrote:

> I have a case of teh stupids.  I can convert dates to epoch using
> localtime() easily enough (and thus manipulate the dates so I can see how
> far in the past a date occurred by subtracting multiples of 86400.. easy
> enough).
> 
> But how can I convert this past date:
> 
> Sun May 11 18:02:35 2008
> 
> .... back to epoch?  I want to subtract the past epoch date from the current
> to find out how many days have passed.  This should be simple (and I'm sure
> it is) but this rusty part of the brain refuses to work and I'm not finding
> what I'm needing from Google.
> 
> Any help would be greatly appreciated.
> 
> Greg


I use Date::Handler quite often, specifically Date::Handler::Range/Delta
would work well.

marc



More information about the TriLUG mailing list