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. System.out.println(
  18. ZoneId // Represent a time zone.
  19. .of( "Australia/Sydney" ) // Get a time zone by its proper name `Continent/Region`. Never use 2-4 letter pseudo-codes such as `CST`.
  20. .getRules() // Get the past, present, and changes to the offset used by the people of this region (this time zone).
  21. .getOffset( // Get the offset in use at a particular moment in this time zone.
  22. Instant.now() // Capture the current moment.
  23. ) // Returns a `ZoneOffset` object.
  24. ) ;
  25.  
  26. }
  27. }
Success #stdin #stdout 0.09s 35640KB
stdin
Standard input is empty
stdout
+11:00