ts -r does not parse all perl Date::Parse formats

Bug #1937091 reported by Ian! D. Allen
6
This bug affects 1 person
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:24T09:08:17.1823213":

$ ts -r
1995:01:24T09:08:17.1823213
1995:01:24T09:08:17.1823213
1995-01-24T09:08:17.1823213
1995-01-24T09:08:17.1823213
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:24T09:08:17.1823213 ISO-8601
1995-01-24T09:08:17.1823213
...
1999 10:02:18 "GMT"

$ perl -w -e 'use Date::Parse; print str2time("1995:01:24T09:08:17.1823213"), "\n";'
790956497.182321

$ perl -w -e 'use Date::Parse; print str2time("1995-01-24T09:08:17.1823213"), "\n";'
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
ProcVersionSignature: Ubuntu 5.8.0-59.66~20.04.1-generic 5.8.18
Uname: Linux 5.8.0-59-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.18
Architecture: amd64
CasperMD5CheckResult: skip
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)

Revision history for this message
Ian! D. Allen (idallen) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.