Skip to content

Latest commit

 

History

History
41 lines (29 loc) · 422 Bytes

format-date.md

File metadata and controls

41 lines (29 loc) · 422 Bytes

How to get current time

package main

import (
  "fmt"
  "time"
)

func main() {
	ct := time.Now()
}
  • "time" - module allows manipulating time
  • time.Now() - returns current date time

group: date

Example:

package main

import (
  "fmt"
  "time"
)

func main() {
	ct := time.Now()
	fmt.Println(ct)
}
2022-02-09 16:11:30.88623962 +0000 UTC m=+0.000039235