user94154 user94154 - 12 days ago 6
Ruby Question

Get the newest and oldest date from a list - Ruby

I have an array of Ruby Date objects. How can I find the newest datetime and the oldest datetime?

Answer
date_array.min # => Oldest
date_array.max # => Most recent