From: "David A. Black" Date: 2005-11-14T01:06:46+09:00 Subject: Re: Converting between Time and DateTime Hi -- On Mon, 14 Nov 2005, Kirk Haines wrote: > On Saturday 12 November 2005 11:26 am, David A. Black wrote: > >> (Could we get all the time/date stuff unified and loaded by default? >> Is that too much overhead?) > > I don't know if that is practical. Time and Date/DateTime use two entirely > different mechanisms for keeping track of the passage of time. Time utilizes > seconds since the start of 1970 -- standard Unix time tracking. > > Date/DateTime uses keeps tracks of days and fractions of days using Rational, > and it's start of time is about the start of the year in 4712 B.C. > > They are quite different, and while one should not have to write one's own > code to convert from one to another -- all three classes should be patched to > allow each conversion from one to another -- they should stay separate. I guess what I'm thinking of mostly is default loading. It seems a little odd to see this: irb(main):002:0> Time => Time irb(main):003:0> require 'time' => true and, in general, to have to know what you can do before you load things and what you can only do after. Not so much reducing the three classes to one, then, but streamlining the way it all works. David -- David A. Black dblack@wobblini.net