Golang time.Time.Minute() function example

package time

Golang time.Time.Minute() function usage example. Useful in finding out the minutes of past and future dates programatically.

 package main

 import (
 "fmt"
 "time"
 )

 func main() {

 now := time.Now()

 fmt.Println("Today : ", now.Format(time.ANSIC))

 minute := now.Minute()

 fmt.Println("Minute : ", minute)
 }

Sample output :

Today : Mon Aug 10 11:45:40 2015

Minute : 45

Reference :

http://golang.org/pkg/time/#Time.Minute

Advertisement