Skip to content
class method

DateTime.commercial

(?::Integer cwyear, ?::Integer cweek, ?::Integer cwday, ?::Integer hour, ?::Integer minute, ?::Integer second, ?::Integer offset, ?::Integer start) -> ::DateTime
DateTime.commercial([cwyear=-4712[, cweek=1[, cwday=1[, hour=0[, minute=0[, second=0[, offset=0[, start=Date::ITALY]]]]]]]]) → datetime

Creates a DateTime object denoting the given week date.

Example
DateTime.commercial(2001) #=> #<DateTime: 2001-01-01T00:00:00+00:00 ...>
DateTime.commercial(2002) #=> #<DateTime: 2001-12-31T00:00:00+00:00 ...>
DateTime.commercial(2001,5,6,4,5,6,'+7')
                          #=> #<DateTime: 2001-02-03T04:05:06+07:00 ...>
See also .civil .httpdate .iso8601 also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0