Simple question, but I can\'t find a good or definitive answer. What is the best and most efficient way to combine Ruby Date and Time objects (objects, not
I found this, but it's not as elegant you would hope:
d = Date.new(2012, 8, 29) t = Time.now dt = DateTime.new(d.year, d.month, d.day, t.hour, t.min, t.sec, t.zone)
By the way, the ruby Time object also stores a year, month, and day, so you would be throwing that away when you create the DateTime.