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.  
  9. /* Name of the class has to be "Main" only if the class is public. */
  10. class Ideone
  11. {
  12. public static void main (String[] args) throws java.lang.Exception
  13. {
  14. // Set < String > ids = ZoneId.getAvailableZoneIds ( );
  15. ZoneId zDefault = ZoneId.systemDefault ( );
  16.  
  17. // ZoneId z = ZoneId.of ( "America/Montreal" );
  18. // ZoneOffset offsetInEffectNowMontreal = z.getRules ( ).getOffset ( Instant.now ( ) );
  19.  
  20. //testing
  21. ZoneId test = ZoneId.of("UTC");
  22. ZoneId test2 = ZoneId.of("Europe/London");
  23. ZoneId test3 = ZoneId.of("Europe/Paris");
  24.  
  25. System.out.println("System Default Zone ID: " + zDefault.getId());
  26.  
  27. System.out.println("testing: ");
  28. System.out.println(test.getId() +"\n" + test2.getId() + "\n" + test3.getId());
  29.  
  30.  
  31. }
  32. }
Success #stdin #stdout 0.25s 59472KB
stdin
Standard input is empty
stdout
System Default Zone ID: GMT
testing: 
UTC
Europe/London
Europe/Paris