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. import java.time.zone.* ;
  12.  
  13.  
  14. /* Name of the class has to be "Main" only if the class is public. */
  15. class Ideone
  16. {
  17. public static void main (String[] args) throws java.lang.Exception
  18. {
  19. System.out.println( "THEN" ) ;
  20. System.out.println(
  21. ZoneId
  22. .of( "America/New_York" )
  23. .getRules()
  24. .isDaylightSavings(
  25. ZonedDateTime
  26. .of(
  27. LocalDate.of( 2013 , Month.APRIL , 5 ) ,
  28. LocalTime.of( 15 , 34 ) ,
  29. ZoneId.of( "America/New_York")
  30. )
  31. .toInstant()
  32. )
  33. );
  34.  
  35. System.out.println(
  36. ZoneId
  37. .of( "America/New_York" )
  38. .getRules()
  39. .getOffset(
  40. ZonedDateTime
  41. .of(
  42. LocalDate.of( 2013 , Month.APRIL , 5 ) ,
  43. LocalTime.of( 15 , 34 ) ,
  44. ZoneId.of( "America/New_York")
  45. )
  46. .toInstant()
  47. )
  48. );
  49.  
  50.  
  51. System.out.println( "NOW" ) ;
  52. System.out.println(
  53. ZoneId
  54. .of( "America/New_York" )
  55. .getRules()
  56. .isDaylightSavings(
  57. Instant.now() ;
  58. )
  59. );
  60.  
  61. System.out.println(
  62. ZoneId
  63. .of( "America/New_York" )
  64. .getRules()
  65. .getOffset(
  66. Instant.now() ;
  67. )
  68. );
  69.  
  70. }
  71. }
Compilation error #stdin compilation error #stdout 0.1s 35888KB
stdin
Standard input is empty
compilation info
Main.java:57: error: ')' expected
                Instant.now() ;
                             ^
Main.java:58: error: illegal start of expression
		    )
		    ^
Main.java:66: error: ')' expected
                Instant.now() ;
                             ^
Main.java:67: error: illegal start of expression
		    )
		    ^
4 errors
stdout
Standard output is empty