Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eMsxp-0007kr-Rw for pgsql-sql@arkaria.postgresql.org; Thu, 07 Dec 2017 09:59:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eMsxp-0003bL-3Z for pgsql-sql@arkaria.postgresql.org; Thu, 07 Dec 2017 09:59:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eMsxo-0003b9-Ty for pgsql-sql@lists.postgresql.org; Thu, 07 Dec 2017 09:59:32 +0000 Received: from mta04.2.doruk.net.tr ([81.21.172.141] helo=mta04.doruk.net.tr) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eMsxm-0007Rw-8C for pgsql-sql@postgresql.org; Thu, 07 Dec 2017 09:59:31 +0000 Received: from cmail19.webkontrol.doruk.net.tr ([212.58.6.99]) by mta04.doruk.net.tr with esmtp (Exim 4.86) (envelope-from ) id 1eMsvc-0008E2-WB for pgsql-sql@postgresql.org; Thu, 07 Dec 2017 12:57:17 +0300 Received: from DESKTOPM80CG12 ([83.66.157.13]) by cmail19.webkontrol.doruk.net.tr (IceWarp 11.1.2.0) with ASMTP id 201712071259289680 for ; Thu, 07 Dec 2017 12:59:28 +0300 From: =?iso-8859-9?B?RXJ0YW4gS/zn/Gtv8Gx1?= To: Subject: Timestamp alculation identical to Microsoft Excel results Date: Thu, 7 Dec 2017 12:59:27 +0300 Message-ID: <001c01d36f42$114e5fb0$33eb1f10$@1nar.com.tr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-9" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Content-Language: tr Thread-Index: AdNvP2F26Hs/4QR9TEuRjpXPK0nzUw== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello, There is this Excel report which will be produced by an application. In Excel, there is below equation 31/10/2017 15:05 - 31/10/2017 14:36:00 =3D 0:28:21 2017-10-31 13:22:17 - 2017-11-01 14:47:45 =3D 1/1/1900 01:25 That is very simple in PostgreSQL. Simply subtract two timestamp without time zone fields and you have the result. However, Excel also represent = that result 0:28:21 as double notation 0.0196874999965075 and 1/1/1900 01:25 = as 1,05935185185081. I could not see any way to have same values using PostgreSQL query. I = tried: extract(epoch from time_field2) - extract(epoch from time_field1) and = result is 1701 and 5128 respectively. Putting aside reasons as to why numbers are used instead of more human understandable time format, I would like to learn if having same results = as Excel is possible. Thanks & regards, Ertan K=FC=E7=FCko=F0lu =20