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.

1
2
3
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
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.