Golang time.Time.Clock() function example

package time

Golang time.Time.Clock() function example usage example

 package main

 import (
 "fmt"
 "time"
 )

 func main() {

 now := time.Now()

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

 hr, min, sec := now.Clock()

 fmt.Printf("Clock : [%d]hour : [%d]minutes : [%d] seconds \n", hr, min, sec)

 }

Sample output :

Today : Mon Aug 3 15:55:25 2015

Clock : [15]hour : [55]minutes : [25] seconds

Reference :

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

Advertisement