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

time: return optional value in parse and parse_iso functions

This commit is contained in:
Alexey
2020-02-06 12:22:00 +03:00
committed by GitHub
parent 1618596218
commit 91e181b14a
3 changed files with 49 additions and 18 deletions

View File

@@ -248,8 +248,12 @@ fn (gen_vc mut GenVC) generate() {
ts_vc := git_log_vc.find_between('Date:', '\n').trim_space()
// parse time as string to time.Time
last_commit_time_v := time.parse(ts_v)
last_commit_time_vc := time.parse(ts_vc)
last_commit_time_v := time.parse(ts_v) or {
panic(err)
}
last_commit_time_vc := time.parse(ts_vc) or {
panic(err)
}
// git dates are in users local timezone and v time.parse does not parse
// timezones at the moment, so for now get unix timestamp from output also