Todays date -

require "date"
puts Date::today() # Output - 2002-07-09

Current time -

puts Time::now() # Output - Tue Jul 09 10:06:52 Mountain Daylight Time 2002

-Rich


----- Original Message -----
From: "Kurt Euler" <keuler / portal.com>
To: "ruby-talk ML" <ruby-talk / ruby-lang.org>
Sent: Tuesday, July 09, 2002 9:50 AM
Subject: Newbie question on returning system date and time...


> Ruby experts:
>
> How does one return system date and time in Ruby? (I'm having trouble
finding out how to do this through online references.)
>
> My main goal is to use current system date and time for naming log files.
So, for time, inclusion of seconds would be desired.
>
> I suppose I need to "require" the Date, Time, and perhaps Parsedate
modules, but I'm not sure where to go from here.
>
> Much obliged!
>
> Thanks.
>
> -Kurt Euler
>