Java LocalDate get day of week

Description

Java LocalDate get day of week

import java.time.DayOfWeek;
import java.time.LocalDate;

public class Main {
  public static void main(String[] args) {
    LocalDate ld = LocalDate.now();

    // Use the method of the LocalDate class to get day-of-week
    DayOfWeek dw5 = ld.getDayOfWeek(); 
    System.out.println(dw5);/*w  w w  .  ja v  a  2  s. com*/
  }
}



PreviousNext

Related