public static OffsetDateTime of (int year, int month, int dayOfMonth, int hour, int minute, int second, int nanoOfSecond, ZoneOffset offset)

Obtains an instance of OffsetDateTime from a year, month, day, hour, minute, second, nanosecond and offset.

This creates an offset date-time with the seven specified fields.

This method exists primarily for writing test cases. Non test-code will typically use other methods to create an offset time. LocalDateTime has five additional convenience variants of the equivalent factory method taking fewer arguments. They are not provided here to reduce the footprint of the API.

Parameters:
year    the year to represent, from MIN_YEAR to MAX_YEAR
month    the month-of-year to represent, from 1 (January) to 12 (December)
dayOfMonth    the day-of-month to represent, from 1 to 31
hour    the hour-of-day to represent, from 0 to 23
minute    the minute-of-hour to represent, from 0 to 59
second    the second-of-minute to represent, from 0 to 59
nanoOfSecond    the nano-of-second to represent, from 0 to 999,999,999
offset    the zone offset, not null

Returns:  the offset date-time, not null

Exceptions:
DateTimeException    if the value of any field is out of range, or if the day-of-month is invalid for the month-year