Bug 1235955 - epoch to timestamp calculation off by one hour
Summary: epoch to timestamp calculation off by one hour
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: Server
Version: 2.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tomas Lestach
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
: 1042909 (view as bug list)
Depends On:
Blocks: space24
TreeView+ depends on / blocked
 
Reported: 2015-06-26 08:01 UTC by Klaas Demter
Modified: 2015-10-08 13:26 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-10-08 13:26:58 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1235752 0 unspecified CLOSED to_timestamp function off by one hour 2021-02-22 00:41:40 UTC

Internal Links: 1235752

Description Klaas Demter 2015-06-26 08:01:49 UTC
Description of problem:
see https://bugzilla.redhat.com/show_bug.cgi?id=1235752

https://github.com/spacewalkproject/spacewalk/blob/e36bc98e7e7a9e8c07b513ff1ab073e303469b3b/java/code/src/com/redhat/rhn/common/db/datasource/xml/System_queries.xml#L840

Version-Release number of selected component (if applicable):
2.3

How reproducible:
rhnschema=# select (to_timestamp('1970-01-01', 'YYYY-MM-DD') + numtodsinterval(S.last_boot, 'second')) from rhnServer S;
           ?column?            
-------------------------------
 2014-12-09 12:48:39.634732+01
 2014-12-16 09:36:06.98596+01
 2014-09-29 10:40:41.794724+02
 2014-12-16 13:34:05.383304+01
 2014-12-09 11:20:40.231759+01
 2014-12-01 15:38:50.426996+01
 2014-12-16 14:45:28.400369+01
 2014-12-16 14:54:40.501109+01
 2015-04-24 11:41:50.632984+02
 2015-01-23 12:30:47.343457+01
 2015-03-11 16:23:56.493301+01
 2015-04-27 10:31:22.163158+02
(12 rows)

rhnschema=# select S.last_boot from rhnServer S;
     last_boot      
--------------------
  1418129319.634732
   1418722566.98596
  1411983641.794724
 1418736845.3833041
 1418124040.2317591
  1417448330.426996
 1418741128.4003689
 1418741680.5011089
 1429872110.6329839
  1422016247.343457
 1426091036.4933009
 1430127082.1631579
(12 rows)

date -d @1418129319
Di 9. Dez 13:48:39 CET 2014

date -d @1430127082
Mo 27. Apr 11:31:22 CEST 2015

Actual results:
incorrect timestamp

Expected results:
correct timestamp


Additional info:

Comment 2 Tomas Lestach 2015-07-10 14:01:06 UTC
Thank you for reporting the issue and a good start with the PR.

spacewalk.git: 4c11d96bf98747b61fba571330d271f1a98d8849

Comment 3 Tomas Lestach 2015-07-10 14:04:09 UTC
*** Bug 1042909 has been marked as a duplicate of this bug. ***

Comment 4 Jan Dobes 2015-10-08 13:26:58 UTC
Spacewalk 2.4 has been released.


Note You need to log in before you can comment on or make changes to this bug.