DateTime.now gone?

S

Shea Martin

Is DateTime.now gone? I believe it was an alias for DateTime.new, but
it renders some old scripts useless.

irb(main):001:0> DateTime.now
NoMethodError: undefined method `now' for DateTime:Class
from (irb):1
irb(main):002:0> DateTime.new
=> #<DateTime:0x2c26588>

~S
 
K

Kenosis

Seems to work fine and pick axe 2 pg 665 lists it w/out mentioning
deprecation. Hmmm...

517-> irb -v
irb 0.9.5(05/04/13)
518-> ruby -v
ruby 1.8.4 (2005-12-24) [i686-linux]
519-> irb
irb(main):001:0> require 'date'
=> true
irb(main):002:0> DateTime.now
=> #<DateTime: 70672729047449761/28800000000,-7/24,2299161>
irb(main):003:0>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top