docs: update type redeclaration example

pull/6393/head
Delyan Angelov 2020-09-16 23:21:02 +03:00
parent 2464deec82
commit bb20586a5e
1 changed files with 6 additions and 1 deletions

View File

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