diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-12-04 06:28:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-04 06:28:34 -0500 |
commit | 05df0c50aed0639fe382efa7d7199083cc09dbc4 (patch) | |
tree | 59ccf5b6fa678384ff83ee0ee1288de92d197041 /pkg | |
parent | d1193b1b8ca6da720b5d4eafff5733e367c07578 (diff) | |
parent | e58fb21ced99db634a38c9e8fbfd04044efe3131 (diff) | |
download | podman-05df0c50aed0639fe382efa7d7199083cc09dbc4.tar.gz podman-05df0c50aed0639fe382efa7d7199083cc09dbc4.tar.bz2 podman-05df0c50aed0639fe382efa7d7199083cc09dbc4.zip |
Merge pull request #8589 from yan12125/container-logs-unix-timestamps
Support Unix timestamps for `podman logs --since`
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/util/utils.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/pkg/util/utils.go b/pkg/util/utils.go index f6a084c00..e0f631eb4 100644 --- a/pkg/util/utils.go +++ b/pkg/util/utils.go @@ -530,6 +530,11 @@ func ParseInputTime(inputTime string) (time.Time, error) { } } + unix_timestamp, err := strconv.ParseInt(inputTime, 10, 64) + if err == nil { + return time.Unix(unix_timestamp, 0), nil + } + // input might be a duration duration, err := time.ParseDuration(inputTime) if err != nil { |