Example usage for java.time DayOfWeek getValue

List of usage examples for java.time DayOfWeek getValue

Introduction

In this page you can find the example usage for java.time DayOfWeek getValue.

Prototype

public int getValue() 

Source Link

Document

Gets the day-of-week int value.

Usage

From source file:Main.java

public static void main(String[] args) {
    LocalDate localDate = LocalDate.of(2014, Month.JUNE, 21);
    DayOfWeek dayOfWeek = DayOfWeek.from(localDate);
    System.out.println(dayOfWeek.getValue());
    dayOfWeek = dayOfWeek.minus(2);/* w w w. j  a v  a2  s  .co m*/
    System.out.println(dayOfWeek.getValue());
}

From source file:Main.java

public static void main(String[] args) {
    LocalDate localDate = LocalDate.of(2014, Month.JUNE, 21);
    DayOfWeek dayOfWeek = DayOfWeek.from(localDate);
    System.out.println(dayOfWeek.getValue());
    dayOfWeek = dayOfWeek.plus(2);//from w w w .j  av  a 2  s. c  o  m
    System.out.println(dayOfWeek.getValue());
}

From source file:Main.java

public static void main(String[] args) {
    LocalDate date = LocalDate.of(2014, 2, 15); // 2014-06-15
    DayOfWeek dayOfWeek = date.getDayOfWeek();
    int dayOfWeekIntValue = dayOfWeek.getValue(); // 6
    String dayOfWeekName = dayOfWeek.name(); // SATURDAY

    System.out.println(dayOfWeekIntValue);
    System.out.println(dayOfWeekName);
}

From source file:Main.java

public static void main(String[] args) {
    DayOfWeek dayOfWeek = DayOfWeek.of(1);
    System.out.println(dayOfWeek.name());
    System.out.println(dayOfWeek.getValue());
    System.out.println(dayOfWeek.ordinal());
}

From source file:Main.java

public static void main(String[] args) {
    DayOfWeek dayOfWeek = DayOfWeek.SUNDAY;
    System.out.println(dayOfWeek.name());
    System.out.println(dayOfWeek.getValue());
    System.out.println(dayOfWeek.ordinal());
}

From source file:Main.java

public static void main(String[] args) {
    DayOfWeek dayOfWeek = DayOfWeek.FRIDAY;
    System.out.println(dayOfWeek.name());
    System.out.println(dayOfWeek.getValue());
    System.out.println(dayOfWeek.ordinal());
}

From source file:Main.java

public static void main(String[] args) {
    DayOfWeek dayOfWeek = DayOfWeek.MONDAY;
    System.out.println(dayOfWeek.name());
    System.out.println(dayOfWeek.getValue());
    System.out.println(dayOfWeek.ordinal());
}

From source file:Main.java

public static void main(String[] args) {
    DayOfWeek dayOfWeek = DayOfWeek.TUESDAY;
    System.out.println(dayOfWeek.name());
    System.out.println(dayOfWeek.getValue());
    System.out.println(dayOfWeek.ordinal());
}

From source file:Main.java

public static void main(String[] args) {
    DayOfWeek dayOfWeek = DayOfWeek.SATURDAY;
    System.out.println(dayOfWeek.name());
    System.out.println(dayOfWeek.getValue());
    System.out.println(dayOfWeek.ordinal());
}

From source file:Main.java

public static void main(String[] args) {
    DayOfWeek dayOfWeek = DayOfWeek.WEDNESDAY;
    System.out.println(dayOfWeek.name());
    System.out.println(dayOfWeek.getValue());
    System.out.println(dayOfWeek.ordinal());
}