On Thu, Jan 29, 2004 at 06:35:54PM +0000, tony summerfelt wrote:
> i want to parse and trim a log file. the date format log file looks like:
>  26 Jan 23:19:26 2004
> 
> to get the time in a format i can use i did
> 
> t1=Time.parse("26 Jan 23:19:26 2004") #string expanded for example
> t2=Time.now

You can do math on t1 and t2 as if they were numbers.  The result is in
seconds.

	secondsAgo = t2 - t1
	daysAgo = secondsAgo /
	        60 /    # seconds per minute
	        60 /    # minutes per hour
	        24      # hours per day

or, just use the result directly:

        daysAgo = secondsAgo / 86_400 # seconds in a day

-Mark