aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/old/examples/fetch.v
blob: e1a7132acc970d0acb5fafbac75e0b8275b16676 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import time
import net.http

fn main() {
	resp := http.get('https://vlang.io/utc_now') or {
		println('failed to fetch data from the server')
		return
	}

	t := time.unix(resp.text.int())
	println(t.format())
}