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
+24.5k Golang : GORM read from database example
+11.5k Use systeminfo to find out installed Windows Hotfix(s) or updates
+10.6k Golang : Bubble sort example
+9k Golang : Populate or initialize struct with values example
+7.5k Golang : Handling Yes No Quit query input
+5.4k Golang : fmt.Println prints out empty data from struct
+25k Golang : Create PDF file from HTML file
+24k Golang : Call function from another package
+4.9k Unix/Linux : secure copying between servers with SCP command examples
+13.1k Golang : List objects in AWS S3 bucket
+11k Golang : Generate random elements without repetition or duplicate
+20.2k Golang : How to get struct tag and use field name to retrieve data?