[Bug 1617234] [NEW] du --time reports wrong time

Alun Perkins 1617234 at bugs.launchpad.net
Fri Aug 26 09:38:56 UTC 2016


Public bug reported:

expect 
du --time --time-style=+%s theFile
to give modification time of theFile expressed as seconds since the epoch.
Comparison to "date" shows that du is reporting the time wrongly.
This script:

echo "my time and time zone:" $(date)
touch timestampTest
echo "date says: " $(date -r timestampTest +%s)
echo "du says:" $(du --time --time-style=+%s timestampTest)

has this output:

my time and time zone: Fri 26 Aug 10:12:38 BST 2016
date says:  1472202758
du says: 0 1472206358 timestampTest

the times are different (an independent check of the time shows that
date is correct, so du must be wrong).

Note that on the other hand, human-readable time DOES work correctly for du.
input : date -r timestampTest +%c 
output: Fri 26 Aug 2016 10:12:38 BST
input : du --time --time-style=+%c timestampTest 
output: 0       Fri 26 Aug 2016 10:12:38 BST    timestampTest
These are the same, as expected.

ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: coreutils 8.25-2ubuntu2
ProcVersionSignature: Ubuntu 4.4.0-34.53-generic 4.4.15
Uname: Linux 4.4.0-34-generic i686
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: i386
CurrentDesktop: KDE
Date: Fri Aug 26 10:29:55 2016
InstallationDate: Installed on 2012-09-28 (1427 days ago)
InstallationMedia: Ubuntu 12.04.1 LTS "Precise Pangolin" - Release i386 (20120817.3)
SourcePackage: coreutils
UpgradeStatus: Upgraded to xenial on 2016-08-19 (6 days ago)

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


** Tags: apport-bug i386 xenial

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

Title:
  du --time reports wrong time

Status in coreutils package in Ubuntu:
  New

Bug description:
  expect 
  du --time --time-style=+%s theFile
  to give modification time of theFile expressed as seconds since the epoch.
  Comparison to "date" shows that du is reporting the time wrongly.
  This script:

  echo "my time and time zone:" $(date)
  touch timestampTest
  echo "date says: " $(date -r timestampTest +%s)
  echo "du says:" $(du --time --time-style=+%s timestampTest)

  has this output:

  my time and time zone: Fri 26 Aug 10:12:38 BST 2016
  date says:  1472202758
  du says: 0 1472206358 timestampTest

  the times are different (an independent check of the time shows that
  date is correct, so du must be wrong).

  Note that on the other hand, human-readable time DOES work correctly for du.
  input : date -r timestampTest +%c 
  output: Fri 26 Aug 2016 10:12:38 BST
  input : du --time --time-style=+%c timestampTest 
  output: 0       Fri 26 Aug 2016 10:12:38 BST    timestampTest
  These are the same, as expected.

  ProblemType: Bug
  DistroRelease: Ubuntu 16.04
  Package: coreutils 8.25-2ubuntu2
  ProcVersionSignature: Ubuntu 4.4.0-34.53-generic 4.4.15
  Uname: Linux 4.4.0-34-generic i686
  ApportVersion: 2.20.1-0ubuntu2.1
  Architecture: i386
  CurrentDesktop: KDE
  Date: Fri Aug 26 10:29:55 2016
  InstallationDate: Installed on 2012-09-28 (1427 days ago)
  InstallationMedia: Ubuntu 12.04.1 LTS "Precise Pangolin" - Release i386 (20120817.3)
  SourcePackage: coreutils
  UpgradeStatus: Upgraded to xenial on 2016-08-19 (6 days ago)

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



More information about the foundations-bugs mailing list