Golang net/http.ParseTime() function example
package net/http
Golang net/http.ParseTime() function usage example
package main
import (
"fmt"
"net/http"
)
func main() {
// example header :
// Accept-Datetime: Thu, 31 May 2007 20:35:00 GMT
time, err := http.ParseTime("Thu, 31 May 2007 20:35:00 GMT")
if err != nil {
panic(err)
}
fmt.Printf("time : %v", time)
}
Output :
time : 2007-05-31 20:35:00 +0000 UTC
Reference :
Advertisement
Something interesting
Tutorials
+9.8k Golang : Qt get screen resolution and display on center example
+13.1k Golang : List objects in AWS S3 bucket
+6.2k Golang : Extract XML attribute data with attr field tag example
+12.6k Golang : Drop cookie to visitor's browser and http.SetCookie() example
+7.7k Golang : get the current working directory of a running program
+6.7k Golang : Experimental emojis or emoticons icons programming language
+7.5k Golang : Handling Yes No Quit query input
+25.3k Golang : Get current file path of a file or executable
+10.1k Golang : Edge detection with Sobel method
+12.1k Golang : Sort and reverse sort a slice of runes
+26.7k Golang : How to check if a connection to database is still alive ?