Golang time.Time.Day() function example
package time
Golang time.Time.Day() function usage example. Useful in finding the day of a given date or today's date.
package main
import (
"fmt"
"time"
)
func main() {
now := time.Now()
fmt.Println("Today : ", now.Format(time.ANSIC))
day := now.Day()
fmt.Println("Day : ", day)
}
Sample output :
Today : Thu Aug 6 10:38:47 2015
Day : 6
Reference :
Advertisement
Something interesting
Tutorials
+23.9k Golang : Use regular expression to validate domain name
+5.6k Fix fatal error: evacuation not done in time problem
+6.1k Golang : Dealing with backquote
+7.9k Golang : How to feed or take banana with Gorilla Web Toolkit Session package
+17.7k Golang : [json: cannot unmarshal object into Go value of type]
+10.6k Android Studio : Simple input textbox and intercept key example
+9.2k Golang : Generate Codabar
+9.9k Golang : Function wrapper that takes arguments and return result example
+6.8k Unix/Linux : How to fix CentOS yum duplicate glibc or device-mapper-libs dependency error?
+40.1k Golang : UDP client server read write example
+8.4k Golang : Ackermann function example
+8.1k Golang : Append and add item in slice