ts -r does not parse all perl Date::Parse formats
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
moreutils (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
"ts -r" does not recognize three of the eleven example formats given in the man page for Perl Date::Parse. In particular, it doesn't recognize the standard ISO-8601 format "1995:01:
$ ts -r
1995:01:
1995:01:
1995-01-
1995-01-
1999 10:02:18 "GMT"
1999 10:02:18 "GMT"
$ man ts
...
If the -r switch is passed, it instead converts existing timestamps in
the input to relative times, such as "15m5s ago". Many common timestamp
formats are supported. Note that the Time::Duration and Date::Parse
perl modules are required for this mode to work.
$ man Date::Parse
...
EXAMPLE DATES
1995:01:
1995-01-
...
1999 10:02:18 "GMT"
$ perl -w -e 'use Date::Parse; print str2time(
790956497.182321
$ perl -w -e 'use Date::Parse; print str2time(
790956497.182321
$ perl -w -e 'use Date::Parse; print str2time("1999 10:02:18 \"GMT\""),
"\n";'
932551338
"ts -r" also doesn't recognize other simple date formats that are recognized by Date::Parse, e.g.
$ ts -r
2000/01/02 03:04
2000/01/02 03:04
2000-01-02 03:04
2000-01-02 03:04
ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: moreutils 0.63-1
ProcVersionSign
Uname: Linux 5.8.0-59-generic x86_64
ApportVersion: 2.20.11-
Architecture: amd64
CasperMD5CheckR
Date: Wed Jul 21 09:56:10 2021
EcryptfsInUse: Yes
InstallationDate: Installed on 2020-10-07 (286 days ago)
InstallationMedia: Lubuntu 20.04.1 LTS "Focal Fossa" - Release amd64 (20200731)
SourcePackage: moreutils
UpgradeStatus: No upgrade log present (probably fresh install)