Skip to content

Instantly share code, notes, and snippets.

@NahianAhmed
Created August 3, 2022 04:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NahianAhmed/488bd31a471517d9180a7b9c7a52d387 to your computer and use it in GitHub Desktop.
Save NahianAhmed/488bd31a471517d9180a7b9c7a52d387 to your computer and use it in GitHub Desktop.
1st day of week in java LocalDateTime
DayOfWeek dayOfWeek = WeekFields.of(Locale.getDefault()).getFirstDayOfWeek();
LocalDateTime firstDayOfWeek = LocalDate.now().atTime(0, 0, 0).with(TemporalAdjusters.previousOrSame(dayOfWeek))
.with(LocalTime.MIN);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment