Golang time.Time.Date() function example
package time
Golang time.Time.Date() function usage example
package main
import (
"fmt"
"time"
)
func main() {
now := time.Now()
fmt.Println("Today : ", now.Format(time.ANSIC))
year, month, day := now.Date()
fmt.Printf("Date : [%d]year : [%d]month : [%d]day \n", year, month, day)
}
Reference :
Advertisement
Something interesting
Tutorials
+6.6k Golang : Warp text string by number of characters or runes example
+4.9k Python : Find out the variable type and determine the type with simple test
+11.3k Golang : Byte format example
+17.6k Golang : delete and modify XML file content
+13k Golang : Get terminal width and height example
+9k Golang : Capture text return from exec function example
+15.7k Golang : Intercept Ctrl-C interrupt or kill signal and determine the signal type
+12.2k Golang : calculate elapsed run time
+10.1k Golang : How to tokenize source code with text/scanner package?
+25.3k Golang : Get current file path of a file or executable
+12.4k Elastic Search : Return all records (higher than default 10)
+26.7k Golang : How to check if a connection to database is still alive ?