Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If I'm not mistaken, requiring the "date" stdlib wasn't required until Ruby 1.9, so that might account for its low spot on the list. I'm not sure but the same might be true for "time".


A little backwards. In 1.9 you don't need to require "date" to use the basic Date class.


Good point. You can definitely instantiate a Time instance without requiring anything:

https://www.omniref.com/ruby/2.1.2/symbols/Time#annotation=1...


Clarifying (since I think your post is easy to misinterpret if someone does not follow the link): The Time class is part of core ruby. Requiring time from stdlib adds some additional methods. Thus it is not necessary to require time to use the Time class, but requiring time _does_ add additional functionality.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: