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

docs: update type redeclaration example

This commit is contained in:
Delyan Angelov 2020-09-16 23:21:02 +03:00
parent 2464deec82
commit bb20586a5e

View File

@ -653,13 +653,18 @@ import time
type MyTime time.Time
fn (mut t MyTime) century() int {
return 1 + t.year % 100
}
fn main() {
my_time := MyTime{
year: 2020,
month: 12,
day: 25
}
println(my_time.unix_time())
println(time.new_time(my_time).utc_string())
println('Century: ${my_time.century()}')
}
```