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
+10.1k Golang : Test a slice of integers for odd and even numbers
+12.1k Golang : Decompress zlib file example
+14.4k Golang : How to filter a map's elements for faster lookup
+14.9k Golang : How to check for empty array string or string?
+29.9k Golang : How to get HTTP request header information?
+24.5k Golang : GORM read from database example
+12.2k Golang : calculate elapsed run time
+8.9k Golang : Sort lines of text example
+9k Golang : Capture text return from exec function example
+4.6k Mac OSX : Get disk partitions' size, type and name
+5.2k Golang : Print instead of building pyramids
+17.4k Golang : Multi threading or run two processes or more example