From: Guillaume Marcais Date: 2004-01-30T03:51:31+09:00 Subject: Re: time comparison t3 = t2 - 24 * 2600 * x # - for Time work on the seconds if t1 < t3 # Do something about it # It is more than x days old end Hope this helps, Guillaume. On Thu, 2004-01-29 at 13:44, 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 > > i'm want to compare the current date/time with the parsed one from the log. > if the line is older than x number of days it will be ignored. > > unfortunately i'm still relatively new a ruby and the 'principle of > least suprise' hit me about a dozen times...with suprises :/ > i'm used to perl's magic. so i'm here for guideance... > > > -- > http://home.cogeco.ca/~tsummerfelt1 >