List of usage examples for java.time YearMonth now
public static YearMonth now()
From source file:Main.java
public static void main(String[] args) { YearMonth y = YearMonth.now(); YearMonth s = y.with(ChronoField.YEAR, 2013); System.out.println(s);/*from ww w .j a v a 2 s . c om*/ }
From source file:Main.java
public static void main(String[] args) { YearMonth y = YearMonth.now(); boolean m = y.isSupported(ChronoField.YEAR); System.out.println(m);//w ww .ja v a 2 s.co m }
From source file:Main.java
public static void main(String[] args) { YearMonth y = YearMonth.now(); String s = y.format(DateTimeFormatter.ofPattern("yyyy MM")); System.out.println(s);/* w w w. java 2 s. c om*/ }
From source file:Main.java
public static void main(String[] argv) { YearMonth currentYearMonth = YearMonth.now(); System.out.printf("Days in month year %s: No of days: %s \n", currentYearMonth, currentYearMonth.lengthOfMonth()); YearMonth creditCardExpiry = YearMonth.of(2018, Month.FEBRUARY); System.out.printf("Your credit card expires on %s: No of days: %s \n", creditCardExpiry, creditCardExpiry.lengthOfMonth()); }
From source file:Main.java
public static void main(String[] args) { System.out.println(toUUUUMM(YearMonth.now())); }
From source file:Main.java
public static void main(String[] args) { YearMonth y = YearMonth.now(); Temporal s = y.adjustInto(YearMonth.of(1990, Month.JANUARY)); System.out.println(s);//from w w w .java 2 s .c o m }
From source file:Main.java
public static void main(String[] args) { YearMonth y = YearMonth.now(); long s = y.until(YearMonth.of(1990, Month.JANUARY), ChronoUnit.YEARS); System.out.println(s);/*from ww w . j ava 2s. c o m*/ }
From source file:Main.java
public static void main(String[] args) { YearMonth y = YearMonth.now(); ValueRange m = y.range(ChronoField.YEAR); System.out.println(m);//ww w. j ava 2s . c om }
From source file:Main.java
public static void main(String[] args) { YearMonth y = YearMonth.now(); Chronology s = y.query(TemporalQueries.chronology()); System.out.println(s);//from w w w . j a va2s.co m }
From source file:Main.java
public static void main(String[] args) { System.out.println(weeksInCalendar(YearMonth.now())); }