ordinal

Date.ordinal([year=-4712[, yday=1[, start=Date::ITALY]]]) â date
Class Public methods

Creates a date object denoting the given ordinal date.

The day of year should be a negative or a positive number (as a relative day from the end of year when negative). It should not be zero.

Date.ordinal(2001)        #=> #<Date: 2001-01-01 ...>
Date.ordinal(2001,34)     #=> #<Date: 2001-02-03 ...>
Date.ordinal(2001,-1)     #=> #<Date: 2001-12-31 ...>

See also jd and new.

doc_ruby_on_rails
2015-04-02 11:05:49
Comments
Leave a Comment

Please login to continue.