lundi 23 janvier 2017

How to generate random time for current date?

When i convert to milliseconds the time shows different time for different DATES. How can i generate the same time for current date.

CODE:

final Random random = new Random();
for (int i = 0; i < 10; i++) {
final LocalTime time = new LocalTime(random.nextLong());
System.out.println(time);
}

Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire