diff options
author | Chih-Hsuan Yen <yan12125@gmail.com> | 2020-12-04 14:43:34 +0800 |
---|---|---|
committer | Chih-Hsuan Yen <yan12125@gmail.com> | 2020-12-04 15:14:31 +0800 |
commit | e58fb21ced99db634a38c9e8fbfd04044efe3131 (patch) | |
tree | 342cd3e342299007e54409ace8aba486ac21cd7f /pkg/util/utils.go | |
parent | 70284b18cc7d4dc478c439cdda60ba64cfec060b (diff) | |
download | podman-e58fb21ced99db634a38c9e8fbfd04044efe3131.tar.gz podman-e58fb21ced99db634a38c9e8fbfd04044efe3131.tar.bz2 podman-e58fb21ced99db634a38c9e8fbfd04044efe3131.zip |
Support Unix timestamps for `podman logs --since`
To match what podman-logs(1) describes --since
Signed-off-by: Chih-Hsuan Yen <yan12125@gmail.com>
Diffstat (limited to 'pkg/util/utils.go')
-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 { |