From: Paul Lutus Date: 2006-10-27T09:15:10+09:00 Subject: Re: Time without Date List Recv wrote: > The problem with Time is that it tracks a date also. > > Let me explain: > > I have a scheduler, which, for example, can be set to do something at 3 > PM. I'd like to store that time in an object, and then take a Time, > chop off the date part, and see if the time matches. Don't you mean chop off the time part: #!/usr/bin/ruby -w t = Time.new h = (t.to_i % 86400) s = h % 60 h /= 60 m = h % 60 h /= 60 puts "Time now: #{sprintf("%02d:%02d:%02d GMT",h,m,s)}" If you extract the number of seconds from a Time object as shown above, you have an integer, not a Time object, and its time is expressed in GMT. -- Paul Lutus http://www.arachnoid.com