List of usage examples for java.time LocalDateTime of
public static LocalDateTime of(int year, int month, int dayOfMonth, int hour, int minute)
From source file:Main.java
public static void main(String[] args) { LocalDateTime a = LocalDateTime.of(2014, 6, 30, 12, 01); System.out.println(a.isSupported(ChronoField.DAY_OF_WEEK)); }
From source file:Main.java
public static void main(String[] args) { LocalDateTime a = LocalDateTime.of(2014, 6, 30, 12, 01); System.out.println(a.getLong(ChronoField.DAY_OF_WEEK)); }
From source file:Main.java
public static void main(String[] args) { LocalDateTime a = LocalDateTime.of(2014, 6, 30, 12, 01); System.out.println(a.get(ChronoField.DAY_OF_WEEK)); }
From source file:Main.java
public static void main(String[] args) { LocalDateTime a = LocalDateTime.of(2014, 6, 30, 12, 01); System.out.println(a.range(ChronoField.DAY_OF_WEEK)); }
From source file:Main.java
public static void main(String[] args) { LocalDateTime a = LocalDateTime.of(2014, 6, 30, 12, 00); LocalDateTime b = LocalDateTime.now(); Temporal t = a.adjustInto(b); System.out.println(t);// w w w .jav a2s . c o m }
From source file:Main.java
public static void main(String[] args) { LocalDateTime a = LocalDateTime.of(2014, 6, 30, 12, 00); long l = a.until(LocalDateTime.now(), ChronoUnit.DAYS); System.out.println(l);// w w w. j a v a2 s .c om }
From source file:Main.java
public static void main(String[] args) { LocalDateTime a = LocalDateTime.of(2014, 6, 30, 12, 00); LocalDateTime t = a.plus(10, ChronoUnit.DAYS); System.out.println(t);//from w ww. jav a 2s . c o m }
From source file:Main.java
public static void main(String[] args) { LocalDateTime a = LocalDateTime.of(2014, 6, 30, 12, 01); LocalDateTime t = a.truncatedTo(ChronoUnit.HOURS); System.out.println(t);//from w w w . j a v a2s . c om }
From source file:Main.java
public static void main(String[] args) { LocalDateTime a = LocalDateTime.of(2014, 6, 30, 12, 01); LocalDateTime t = a.with(ChronoField.YEAR, 2012); System.out.println(t);/*from w w w .j a va 2 s . c o m*/ }
From source file:Main.java
public static void main(String[] args) { LocalDateTime a = LocalDateTime.of(2014, 6, 30, 12, 00); String s = a.format(DateTimeFormatter.ISO_DATE); System.out.println(s);//from w w w . ja v a2 s. co m }