From 285de706f7c41dfaa7f1b43bbba6ca056e7d0d62 Mon Sep 17 00:00:00 2001 From: raul Date: Mon, 25 Mar 2024 17:24:03 +0100 Subject: [PATCH] Added get-time exercise --- get-time/go.mod | 3 +++ get-time/main.go | 11 +++++++++++ 2 files changed, 14 insertions(+) create mode 100644 get-time/go.mod create mode 100644 get-time/main.go diff --git a/get-time/go.mod b/get-time/go.mod new file mode 100644 index 0000000..60fc611 --- /dev/null +++ b/get-time/go.mod @@ -0,0 +1,3 @@ +module get-time + +go 1.22.1 diff --git a/get-time/main.go b/get-time/main.go new file mode 100644 index 0000000..a06fc7b --- /dev/null +++ b/get-time/main.go @@ -0,0 +1,11 @@ +package main + +import ( + "fmt" + "time" +) + +func main() { + t := time.Now() + fmt.Printf("%d-%02d-%02dT%02d:%02d:%02d\n", t.Year(), t.Month(), t.Day(), t.Hour(), t.Minute(), t.Second()) +}