MCPcopy Create free account
hub / github.com/DiUS/java-faker / future

Method future

src/main/java/com/github/javafaker/DateAndTime.java:36–40  ·  view source on GitHub ↗

Generates a future date from now. Note that there is a 1 second slack to avoid generating a past date. @param atMost at most this amount of time ahead from now exclusive. @param unit the time unit. @return a future date from now.

(int atMost, TimeUnit unit)

Source from the content-addressed store, hash-verified

34 * @return a future date from now.
35 */
36 public Date future(int atMost, TimeUnit unit) {
37 Date now = new Date();
38 Date aBitLaterThanNow = new Date(now.getTime() + 1000);
39 return future(atMost, unit, aBitLaterThanNow);
40 }
41
42 /**
43 * Generates a future date from now, with a minimum time.

Callers 2

testFutureDateMethod · 0.80

Calls 2

nextLongMethod · 0.80
randomMethod · 0.45

Tested by 2

testFutureDateMethod · 0.64