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.temporal.* ;
  9. import java.time.format.* ;
  10.  
  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. ZonedDateTime zdt1 = ZonedDateTime.of( 2017 , 9 , 21 , 23 , 59 , 0 , 0 , ZoneId.of( "Asia/Tehran" ) );
  19. ZonedDateTime zdt2 = zdt1.plusMinutes( 1 );
  20.  
  21. System.out.println( "zdt1: " + zdt1 );
  22. System.out.println( "zdt2: " + zdt2 );
  23.  
  24.  
  25. }
  26. }
Success #stdin #stdout 0.12s 4575232KB
stdin
Standard input is empty
stdout
zdt1: 2017-09-21T23:59+04:30[Asia/Tehran]
zdt2: 2017-09-21T23:00+03:30[Asia/Tehran]