Standard library / net/http

http.TimeFormat

HTTP date formatting layout with a literal GMT suffix; convert the time to UTC first. Expected stdout: 'Thu, 01 Jan 1970 00:00:00 GMT\n'.

Formal Syntax & Structure

go syntaxgo
const TimeFormat = "Mon, 02 Jan 2006 15:04:05 GMT"

Working Example

Example Snippetgo
package main
import (  "fmt"  "net/http"  "time")
func main() { fmt.Println(time.Unix(0, 0).UTC().Format(http.TimeFormat)) }
func must[T any](v T, e error) T {  if e != nil {    panic(e)  }  return v}func check(e error) {  if e != nil {    panic(e)  }}
Go Reference