time: fix rand()
parent
b57752e67e
commit
0e798b4c51
|
@ -46,14 +46,10 @@ pub fn now() Time {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn random() Time {
|
pub fn random() Time {
|
||||||
return Time {
|
now_unix := now().uni
|
||||||
year: rand.next(2) + 201
|
rand_unix := rand.next(now_unix)
|
||||||
month: rand.next(12) + 1
|
|
||||||
day: rand.next(30) + 1
|
return time.unix(rand_unix)
|
||||||
hour: rand.next(24)
|
|
||||||
minute: rand.next(60)
|
|
||||||
second: rand.next(60)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
Loading…
Reference in New Issue