Skip to content

Commit

Permalink
Merge pull request #86 from tri-adam/fmt-utc
Browse files Browse the repository at this point in the history
Always format times in UTC
  • Loading branch information
tri-adam authored Jul 15, 2020
2 parents f7016b5 + 070d166 commit 1bffd1d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions internal/app/siftool/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ func List(file string) error {
}()

fmt.Println("Container id:", fimg.Header.ID)
fmt.Println("Created on: ", time.Unix(fimg.Header.Ctime, 0))
fmt.Println("Modified on: ", time.Unix(fimg.Header.Mtime, 0))
fmt.Println("Created on: ", time.Unix(fimg.Header.Ctime, 0).UTC())
fmt.Println("Modified on: ", time.Unix(fimg.Header.Mtime, 0).UTC())
fmt.Println("----------------------------------------------------")

fmt.Println("Descriptor list:")
Expand Down
8 changes: 4 additions & 4 deletions pkg/sif/fmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ func (fimg *FileImage) FmtHeader() string {
s += fmt.Sprintln("Version: ", trimZeroBytes(fimg.Header.Version[:]))
s += fmt.Sprintln("Arch: ", GetGoArch(trimZeroBytes(fimg.Header.Arch[:])))
s += fmt.Sprintln("ID: ", fimg.Header.ID)
s += fmt.Sprintln("Ctime: ", time.Unix(fimg.Header.Ctime, 0))
s += fmt.Sprintln("Mtime: ", time.Unix(fimg.Header.Mtime, 0))
s += fmt.Sprintln("Ctime: ", time.Unix(fimg.Header.Ctime, 0).UTC())
s += fmt.Sprintln("Mtime: ", time.Unix(fimg.Header.Mtime, 0).UTC())
s += fmt.Sprintln("Dfree: ", fimg.Header.Dfree)
s += fmt.Sprintln("Dtotal: ", fimg.Header.Dtotal)
s += fmt.Sprintln("Descoff: ", fimg.Header.Descroff)
Expand Down Expand Up @@ -229,8 +229,8 @@ func (fimg *FileImage) FmtDescrInfo(id uint32) string {
}
s += fmt.Sprintln(" Fileoff: ", v.Fileoff)
s += fmt.Sprintln(" Filelen: ", v.Filelen)
s += fmt.Sprintln(" Ctime: ", time.Unix(v.Ctime, 0))
s += fmt.Sprintln(" Mtime: ", time.Unix(v.Mtime, 0))
s += fmt.Sprintln(" Ctime: ", time.Unix(v.Ctime, 0).UTC())
s += fmt.Sprintln(" Mtime: ", time.Unix(v.Mtime, 0).UTC())
s += fmt.Sprintln(" UID: ", v.UID)
s += fmt.Sprintln(" Gid: ", v.Gid)
s += fmt.Sprintln(" Name: ", trimZeroBytes(v.Name[:]))
Expand Down

0 comments on commit 1bffd1d

Please sign in to comment.