time: fix rand()

pull/1421/head
Sylvio Tavares 2019-08-01 18:31:02 -04:00 committed by Alexander Medvednikov
parent b57752e67e
commit 0e798b4c51
1 changed files with 4 additions and 8 deletions

View File

@ -46,14 +46,10 @@ pub fn now() Time {
}
pub fn random() Time {
return Time {
year: rand.next(2) + 201
month: rand.next(12) + 1
day: rand.next(30) + 1
hour: rand.next(24)
minute: rand.next(60)
second: rand.next(60)
}
now_unix := now().uni
rand_unix := rand.next(now_unix)
return time.unix(rand_unix)
}
const (