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.getDayOfMonth()); }
From source file:Main.java
public static void main(String[] args) { LocalDateTime a = LocalDateTime.of(2014, 6, 30, 12, 01); System.out.println(a.toLocalDate().getYear()); }
From source file:Main.java
public static void main(String[] args) { LocalDateTime a = LocalDateTime.of(2014, 6, 30, 12, 01); System.out.println(a.getSecond()); }
From source file:Main.java
public static void main(String[] args) { LocalDateTime a = LocalDateTime.of(2012, 6, 30, 12, 00); LocalDateTime b = LocalDateTime.of(2012, 7, 1, 12, 00); System.out.println(a.isBefore(b)); System.out.println(a.isBefore(a)); }
From source file:Main.java
public static void main(String[] args) { LocalDateTime a = LocalDateTime.of(2012, 6, 30, 12, 00); LocalDateTime b = LocalDateTime.of(2012, 7, 1, 12, 00); System.out.println(a.compareTo(b)); System.out.println(a.compareTo(a)); }
From source file:Main.java
public static void main(String[] args) { LocalDateTime a = LocalDateTime.of(2012, 6, 30, 12, 00); LocalDateTime b = LocalDateTime.of(2012, 7, 1, 12, 00); System.out.println(a.isAfter(b)); System.out.println(a.isAfter(a)); }
From source file:Main.java
public static void main(String[] args) { LocalDateTime a = LocalDateTime.of(2014, 6, 30, 12, 01); LocalDateTime t = a.withMinute(34); System.out.println(t);// w w w. j ava 2s . 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.plusWeeks(100); System.out.println(t);//from w w w. java2 s . c o m }
From source file:Main.java
public static void main(String[] args) { LocalDateTime a = LocalDateTime.of(2014, 6, 30, 12, 00); LocalDateTime t = a.minusHours(100); System.out.println(t);// w ww . j av a 2s . com }
From source file:Main.java
public static void main(String[] args) { LocalDateTime a = LocalDateTime.of(2014, 6, 30, 12, 00); LocalDateTime t = a.plusNanos(100); System.out.println(t);//from w w w. java 2s. c o m }