[Bug 1970105] Re: Date gives back wrong second count, 3600 seconds off

Hannu E K N 1970105 at bugs.launchpad.net
Sun Apr 24 14:08:01 UTC 2022


Corrected output:

$ echo $(( 3600 + $(date +%s -d'1970-01-01 00:02:18') ))

-- 
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/1970105

Title:
  Date gives back wrong second count, 3600 seconds off

Status in coreutils package in Ubuntu:
  New

Bug description:
  In my opinion, the required '1970-01-01 **01**:02:18' below is wrong.
  The answer should be 3600 more seconds.

  Note: **02:18 is 138 seconds.**


  
  $ man date
  ...
  %s     seconds since 1970-01-01 00:00:00 UTC
  ...

  $ date +%s -d'1970-01-01 01:02:18'
  138

  $ date --version
  date (GNU coreutils) 8.30
  Copyright (C) 2018 Free Software Foundation, Inc.
  License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
  This is free software: you are free to change and redistribute it.
  There is NO WARRANTY, to the extent permitted by law.

  Written by David MacKenzie.

  $

  ProblemType: Bug
  DistroRelease: Ubuntu 20.04
  Package: coreutils 8.30-3ubuntu2
  ProcVersionSignature: Ubuntu 5.13.0-40.45~20.04.1-generic 5.13.19
  Uname: Linux 5.13.0-40-generic x86_64
  NonfreeKernelModules: nvidia_modeset nvidia
  ApportVersion: 2.20.11-0ubuntu27.23
  Architecture: amd64
  CasperMD5CheckResult: skip
  CurrentDesktop: ubuntu:GNOME
  Date: Sun Apr 24 15:12:14 2022
  SourcePackage: coreutils
  UpgradeStatus: No upgrade log present (probably fresh install)

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




More information about the foundations-bugs mailing list