2009/10/2 Robert Walker <[email protected]>: > > Colin Law wrote: >> If you have the local time in a known time zone put it into a ruby >> Time object (which, confusingly, includes a date) then you can use >> dst? to determine whether it is in dst or not. > > Cool. I hadn't had a chance to go looking for a method in Ruby to > determine dst. I knew one exited in Java. It's good to know that .dst? > is the ticket. Do you know whether Ruby maintains it's own timezones > database or asks the host OS to look it up from the system's database?
Don't know. I guess the system or Ruby would have to be updated regularly to keep it up to date, DST dates keep changing. > >> Time object (which, confusingly, includes a date) > Confusing to some maybe, but anyone who has ever done any serious date > math knows that time is meaningless apart from date. When there is also a DateTime class it is confusing. The discussion has been had many times before, but there are times when a TimeOfDay class would be useful without a date. For an alarm that goes off at the same time every day for example. > > After years in existence the Java folks still aren't completely happy > with the standard Date and Time objects. In fact it's been redone > several times, and still people often dump the standard classes in favor > of Joda time. It might sound simple, but in reality it's far from it. Definitely Colin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

