Standard library / archive/zip

archive/zip.FileHeader.ModTime()

Deprecated accessor for the legacy DOS timestamp; prefer Modified for richer time information. Expected stdout: '2024-01-02T03:04:06Z\n'.

Formal Syntax & Structure

go syntaxgo
func (h *FileHeader) ModTime() time.Time

Return Value

time.Time

Modification timestamp.

Working Example

Example Snippetgo
package main
import (  "archive/zip"  "fmt"  "time")
func must(e error) {  if e != nil {    panic(e)  }}
func main() {  h := zip.FileHeader{}  h.SetModTime(time.Date(2024, 1, 2, 3, 4, 6, 0, time.UTC))  fmt.Println(h.ModTime().Format(time.RFC3339))}
Go Reference