Golang time.Time.Second() function example
package time
Golang time.Time.Second() function usage example. Useful in calculating second from given data programatically.
package main
import (
"fmt"
"time"
)
func main() {
now := time.Now()
fmt.Println("Today : ", now.Format(time.ANSIC))
sec := now.Second()
fmt.Println("Second : ", sec)
}
Sample output :
Today : Mon Aug 10 12:00:03 2015
Second : 3
Reference :
Advertisement
Something interesting
Tutorials
+22k Fix "Failed to start php5-fpm.service: Unit php5-fpm.service is masked."
+9k Golang : Get SPF and DMARC from email headers to fight spam
+6.5k Grep : How to grep for strings inside binary data
+31.5k Golang : bufio.NewReader.ReadLine to read file line by line
+10.1k Golang : Find and replace data in all files recursively
+10.8k Android Studio : Checkbox for user to select options example
+13k Golang : Get terminal width and height example
+17.5k Golang : Linked list example
+7.4k Golang : Accessing dataframe-go element by row, column and name example
+30.4k Golang : How to redirect to new page with net/http?
+13.4k Golang : Generate Code128 barcode
+14.4k Golang : Parsing or breaking down URL