Examples of ChronoZonedDateTime


Examples of java.time.chrono.ChronoZonedDateTime

    assertTrue( constraint.isValid( null, null ), "null fails validation." );

    // Test allowed zone offsets (UTC-18 to UTC+18) with 1 hour increments
    for ( int i = -18; i <= 18; i++ ) {
      ZoneId zone = ZoneId.ofOffset( "UTC", ZoneOffset.ofHours( i ) );
      ChronoZonedDateTime future = ZonedDateTime.now( zone ).plusHours( 1 );
      ChronoZonedDateTime past = ZonedDateTime.now( zone ).minusHours( 1 );
      assertTrue( constraint.isValid( future, null ), "Future ZonedDateTime '" + future + "' fails validation." );
      assertFalse( constraint.isValid( past, null ), "Past ZonedDateTime '" + past + "' validated as future." );
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.