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
+25.7k Golang : How to write CSV data to file
+6.9k Golang : How to setup a disk space used monitoring service with Telegram bot
+10.9k Golang : Get UDP client IP address and differentiate clients by port number
+20.2k Golang : Reset or rewind io.Reader or io.Writer
+22.4k Golang : How to read JPG(JPEG), GIF and PNG files ?
+21.2k Golang : How to get time zone and load different time zone?
+6k Javascript : Get operating system and browser information
+41.9k Golang : How do I convert int to uint8?
+5.8k Unix/Linux : Get reboot history or check when was the last reboot date
+22.9k Golang : Calculate time different
+19.1k Golang : Display list of time zones with GMT
+11.6k Golang : Concurrency and goroutine example