Date gives back wrong second count, 3600 seconds off

Bug #1970105 reported by Hannu E K N
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
coreutils (Ubuntu)
New
Undecided
Unassigned

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)

Revision history for this message
Hannu E K N (hannu-n) wrote :
Revision history for this message
Hannu E K N (hannu-n) wrote :

Corrected output:

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

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.