Date gives back wrong second count, 3600 seconds off
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:/
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
ProcVersionSign
Uname: Linux 5.13.0-40-generic x86_64
NonfreeKernelMo
ApportVersion: 2.20.11-
Architecture: amd64
CasperMD5CheckR
CurrentDesktop: ubuntu:GNOME
Date: Sun Apr 24 15:12:14 2022
SourcePackage: coreutils
UpgradeStatus: No upgrade log present (probably fresh install)
Corrected output:
$ echo $(( 3600 + $(date +%s -d'1970-01-01 00:02:18') ))