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 { 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 (