Matt Spendlove wrote:
(...)
>> >
>>
>> DAY_DURATION = 24*60*60
>> date = Time.now - 14*DAY_DURATION
> 
> Right, I get this but there is no way to convert a Date to a Time? I
> guess I was looking for timeInMillis or something. Perhaps just need
> to loose the Java head ;)
> 
> Thanks.

timeInMillis would be stored in a fixnum. Hmm, let's try .to_f .

date_in_millis = Time.now.to_f - 14*DAY_DURATION
=>1199223885.312

To revert this:

puts Time.at(date_in_millis)
Tue Jan 01 22:52:52 +0100 2008

(I had to look this one up).

Regards,

Siep
-- 
Posted via http://www.ruby-forum.com/.