fork(1) 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. System.out.println(
  15. OffsetDateTime
  16. .parse( "2021-08-07T03:00:01-07:00" )
  17. .isBefore(
  18. OffsetDateTime.parse( "2021-08-07T15:30:00+05:30" )
  19. )
  20. );
  21.  
  22. String s1="2021-08-07T03:00:01-07:00";
  23. String s2="2021-08-07T15:30:00+05:30";
  24. OffsetDateTime odt1 = OffsetDateTime.parse( s1 ) ;
  25. OffsetDateTime odt2 = OffsetDateTime.parse( s2 ) ;
  26. boolean odt1IsEarlier = odt1.isBefore( odt2 ) ;
  27.  
  28. System.out.println( "odt1IsEarlier: " + odt1IsEarlier ) ;
  29. }
  30. }
Success #stdin #stdout 0.13s 51692KB
stdin
Standard input is empty
stdout
false
odt1IsEarlier: false