fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. import java.time.* ;
  8. import java.time.format.* ;
  9. import java.time.temporal.* ;
  10. import java.time.chrono.* ;
  11.  
  12. /* Name of the class has to be "Main" only if the class is public. */
  13. class Ideone
  14. {
  15. public static void main (String[] args) throws java.lang.Exception
  16. {
  17.  
  18. System.out.println(
  19.  
  20. LocalDate // Represent a date-only value without a time-of-day and without a time zone.
  21. .now( // Determine the current date as seen through the wall-clock time used by people in certain region (a time zone).
  22. ZoneId.of( "America/Montreal" ) // Real time zone names have names in the format of `Continent/Region`. Never use 2-4 letter pseudo-zones such as `IST`, `PST`, or `CST`, which are neither standardized nor unique.
  23. ) // Return a `LocalDate`.
  24. .with( // Move from one date another by passing a `TemporalAdjuster` implementation.
  25. TemporalAdjusters // Class providing several implementations of `TemporalAdjuster`.
  26. .firstDayOfNextMonth() // This adjuster finds the date of the first of next month, as its name suggests.
  27. ) // Returns another `LocalDate` object. The original `LocalDate` object is unaltered.
  28. .toString()
  29.  
  30. );
  31. }
  32. }
Success #stdin #stdout 0.1s 36072KB
stdin
Standard input is empty
stdout
2020-02-01