Support Unix timestamps for podman logs --since

To match what podman-logs(1) describes --since

Signed-off-by: Chih-Hsuan Yen <yan12125@gmail.com>
This commit is contained in:
Chih-Hsuan Yen
2020-12-04 14:43:34 +08:00
parent 70284b18cc
commit e58fb21ced
2 changed files with 8 additions and 0 deletions

View File

@ -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 {