dayOfWeek
dayOfWeek returns the day of the week, as a java.time.DayOfWeek value, for an input date-time in the specified time zone. To get the day of the week as an integer, with 1 being Monday and 7 being Sunday, use dayOfWeekValue instead.
Syntax
Parameters
| Parameter | Type | Description |
|---|---|---|
| instant | Instant | The instant for which to find the day of the week. |
| timeZone | ZoneId | The time zone to use when interpreting the date-time. |
| dateTime | ZonedDateTime | The zoned date-time for which to find the day of the week. |
| localDateTime | LocalDateTime | The local date-time for which to find the day of the week. |
| localDate | LocalDate | The local date for which to find the day of the week. |
Returns
Returns the day of the week as a java.time.DayOfWeek value, such as THURSDAY.