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 :
Advertisement
Something interesting
Tutorials
+8.2k Golang : Add build version and other information in executables
+12.3k Golang : Validate email address
+10.8k Android Studio : Checkbox for user to select options example
+18.6k Golang : Iterating Elements Over A List
+4.3k Golang : Converting individual Jawi alphabet to Rumi(Romanized) alphabet example
+7.9k Swift : Convert (cast) String to Float
+11.2k Golang : Proper way to test CIDR membership of an IP 4 or 6 address example
+5.2k Golang : The Tao of importing package
+21.8k Golang : How to reverse slice or array elements order
+10.6k Golang : Flip coin example
+8.5k Golang : How to check variable or object type during runtime?
+5.6k Golang : Shortening import identifier