The DateTime
class inherits the cwday
method from the Date
class, so yes. I suggest visiting www.ruby-doc.org. Date
and DateTime
are in the standard (not core) library. Remember to choose the correct ruby version.
Also, if you're concerned about performance, there shouldn't be any performance penalty when using DateTime#cwday
because the method is inherited from Date
(not overridden). Note also that in ruby 1.8.7, both classes are written in pure ruby; while in 1.9, they're compiled C code (ruby-doc shows date_core.c as the source file). Your date code will likely run faster in 1.9.