Hi,
On Ruby 1.8.7 and 1.9 somewhere (some ARM NAS device).
Does anyone know if there is a Date.now in 1.9, or one proposed?
It's a little tedious to go through Date.strptime(Time.now.strftime)
don't you think? Easy enough to extend Date, but why not in Ruby
already?
Just a thought. Save my fingers and all that.
Apologies if I'm musing in the wrong zone.
M
···
--
Posted via http://www.ruby-forum.com/ .
Mike Flint wrote in post #979117:
Hi,
On Ruby 1.8.7 and 1.9 somewhere (some ARM NAS device).
Does anyone know if there is a Date.now in 1.9, or one proposed?
It's a little tedious to go through Date.strptime(Time.now.strftime)
don't you think? Easy enough to extend Date, but why not in Ruby
already?
Just a thought. Save my fingers and all that.
Apologies if I'm musing in the wrong zone.
M
Date.today.to_s
=> "2011-02-02"
···
--
Posted via http://www.ruby-forum.com/\ .
You could just use Date.today
Works in both 1,8.* and 1.9.*
It is also in the documentation
Peter Hickman wrote in post #979120:
You could just use Date.today
Works in both 1,8.* and 1.9.*
It is also in the documentation
Thanks. I guess my point was (probably) that Date.now is more intuitive
than Date.today. Well, at least to me, evidently, given that Time.now
came first.
···
--
Posted via http://www.ruby-forum.com/\ .
botp1
(botp)
2 February 2011 15:35
5
Thanks. I guess my point was (probably) that Date.now is more intuitive
than Date.today.
not an anglois expert here, but
"date today not date now"
"time now not time today"
Well, at least to me, evidently, given that Time.now came first.
you can always alias anytime..
best regards -botp
···
On Wed, Feb 2, 2011 at 10:11 PM, Mike Flint <mfcoder-ap@yahoo.co.uk> wrote: