From 9cfb118f56cacc3476689c1c01938531851742b1 Mon Sep 17 00:00:00 2001 From: an1l4 <1995anila@gmail.com> Date: Tue, 21 Jun 2022 10:57:40 +0530 Subject: [PATCH] Time --- time_package.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 time_package.go diff --git a/time_package.go b/time_package.go new file mode 100644 index 0000000..77d276b --- /dev/null +++ b/time_package.go @@ -0,0 +1,15 @@ +package main + +import ( + "fmt" + "time" +) + +func main() { + presentTime := time.Now() + fmt.Println(presentTime.Format("01-02-2006 15:04:05 Monday")) //we have to follow the same format 01-02-2006 + + createDate := time.Date(2018, time.March, 27, 03, 00, 00, 00, time.UTC) + fmt.Println(createDate) + fmt.Println(createDate.Format("01-02-2006 15:04:05 Monday")) +}