[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    time comparison
From:       tony summerfelt <snowzone5 () hotmail ! com>
Date:       2004-01-29 18:44:54
Message-ID: eocSb.507$_62.257 () read1 ! cgocable ! net
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic