On Mon, Aug 25, 2008 at 6:12 PM, Erik Hollensbe <erik / hollensbe.org> wrote:
> Matthew Moss wrote:
>
>> Nice and easy one this week. Your task is to write a Ruby script that
>> reports the date and time of your last reboot, making use of  the
>> `uptime` command.
>>
>> While `uptime` is available on the various Unixes and Mac OS X,
>> Windows users might need to do a little extra work. Here are [two][1]
>> [options][2] for Windows users.
>
> last | grep reboot | head -1
>
> Am I doing it right? :P
>

This works for me on OS X.

require 'time'
Time.parse `last | tail -1`

Michael Guterl