1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

time: fix rand()

This commit is contained in:
Sylvio Tavares 2019-08-01 18:31:02 -04:00 committed by Alexander Medvednikov
parent b57752e67e
commit 0e798b4c51

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 (