public static Date newRandomDate ( final Date from ) { final Random secrand = new SecureRandom ( ) ; final double randDouble = - secrand . nextDouble ( ) * from . getTime ( ) ; final double randomDouble = from . getTime ( ) - secrand . nextDouble ( ) ; final double result = randDouble * randomDouble ; return new Date ( ( long ) result ) ; }
Creates the random date .