Public bug reported:

"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)

** Affects: moreutils (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: amd64 apport-bug focal third-party-packages

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1937091

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

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/moreutils/+bug/1937091/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to