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
+17.4k Golang : Check if IP address is version 4 or 6
+6.8k Golang : Calculate pivot points for a cross
+7.2k Golang : Dealing with postal or zip code example
+4.9k Nginx and PageSpeed build from source CentOS example
+10.6k Golang : Get local time and equivalent time in different time zone
+5k Golang : Constant and variable names in native language
+8.1k Golang : Multiplexer with net/http and map
+6.1k Java : Human readable password generator
+10.6k Golang : Resolve domain name to IP4 and IP6 addresses.
+13.4k Golang : Verify token from Google Authenticator App
+18.5k Golang : Set, Get and List environment variables
+7.1k Golang : Gorrila mux.Vars() function example