OffsetDate class
A combination of a LocalDate and an Offset, to represent a date at a specific offset from UTC but without any time-of-day information.
This type is immutable.
- Annotations
-
- @immutable
Constructors
- OffsetDate(LocalDate calendarDate, Offset offset)
-
Constructs an instance of the specified date and offset.
const
Properties
- calendar → CalendarSystem
-
Gets the calendar system associated with this offset date.
no setter
- calendarDate → LocalDate
-
Gets the local date represented by this value.
final
- dayOfMonth → int
-
Gets the day of this offset date within the month.
no setter
- dayOfWeek → DayOfWeek
-
Gets the week day of this offset date expressed as an DayOfWeek value.
no setter
- dayOfYear → int
-
Gets the day of this offset date within the year.
no setter
- era → Era
-
Gets the era of this offset date.
no setter
- hashCode → int
-
Returns a hash code for this offset date.
no setteroverride
- monthOfYear → int
-
Gets the month of this offset date within the year.
no setter
- offset → Offset
-
Gets the local date represented by this value.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- year → int
-
Gets the year of this offset date.
This returns the 'absolute year', so, for the ISO calendar,
a value of 0 means 1 BC, for example.
no setter
- yearOfEra → int
-
Gets the year of this offset date within the era.
no setter
Methods
-
adjust(
LocalDate adjuster(LocalDate)) → OffsetDate - Returns this offset date, with the given date adjuster applied to it, maintaining the existing offset.
-
at(
LocalTime time) → OffsetDateTime - Combines this OffsetDate with the given LocalTime into an OffsetDateTime.
-
equals(
OffsetDate other) → bool - Compares two OffsetDate values for equality. This requires that the date values be the same (in the same calendar) and the offsets.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
[String? patternText, Culture? culture]) → String -
Returns a String that represents this instance.
override
-
withCalendar(
CalendarSystem calendar) → OffsetDate - Creates a new OffsetDate representing the same physical date and offset, but in a different calendar. The returned value is likely to have different date field values to this one. For example, January 1st 1970 in the Gregorian calendar was December 19th 1969 in the Julian calendar.
-
withOffset(
Offset offset) → OffsetDate - Creates a new OffsetDate for the same date, but with the specified UTC offset.
Operators
-
operator ==(
Object right) → bool -
Implements the operator == (equality).
override