HW1 is completed

pull/1/head
Andrey Ivanov 2020-05-29 12:56:48 +03:00
parent 43a5317fed
commit bd7ece88f4
1 changed files with 6 additions and 2 deletions

View File

@ -16,6 +16,10 @@ func main() {
if err != nil { if err != nil {
log.Fatalf("Ошибка запроса: %e", err) log.Fatalf("Ошибка запроса: %e", err)
} }
fmt.Printf("current time: %s\n", timeCurrent.Round(time.Second).String()) fmt.Printf("current time: %s\n", timeFormat(timeCurrent))
fmt.Printf("exact time: %s\n", timeExact.Round(time.Second).String()) fmt.Printf("exact time: %s\n", timeFormat(timeExact))
}
func timeFormat(t time.Time) string {
return t.Format("2006-01-02 15:04:05 -0700 UTC")
} }