2020-04-28 13:57:48 +02:00
|
|
|
import time
|
|
|
|
import net.http
|
|
|
|
|
|
|
|
fn main() {
|
2021-02-23 18:43:44 +01:00
|
|
|
resp := http.get('https://vlang.io/utc_now') or {
|
2021-09-01 00:43:35 +02:00
|
|
|
eprintln('Failed to fetch data from the server. Error: $err')
|
2021-02-23 18:43:44 +01:00
|
|
|
return
|
|
|
|
}
|
2020-04-28 13:57:48 +02:00
|
|
|
|
2022-05-29 19:27:18 +02:00
|
|
|
t := time.unix(resp.body.int())
|
2021-02-23 18:43:44 +01:00
|
|
|
println(t.format())
|
2020-04-28 13:57:48 +02:00
|
|
|
}
|