pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: ravi105173@gmail.com
Subject: BUG #18883: Epoch issue
Date: Tue, 08 Apr 2025 12:00:14 +0000
Message-ID: <18883-2c45e318b3a3e513@postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      18883
Logged by:          RAVI KANT BHUSHAN
Email address:      ravi105173@gmail.com
PostgreSQL version: 16.1
Operating system:   Windows 10
Description:        

Number of days calculation using EPOCH is not providing right answer:

Query:      SELECT (EXTRACT(EPOCH FROM ('2025-04-08 11:25:01'::timestamp -
'2025-03-13 15:33:30'::timestamp)) / 86400)::INT   
                    ==> output is 26, but right answer is 25 days



view thread (2+ messages)  latest in thread

Message-ID: <18883-2c45e318b3a3e513@postgresql.org>
Permalink:  ../18883-2c45e318b3a3e513@postgresql.org/
Also on:    postgresql.org/message-id/18883-2c45e318b3a3e513@postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, ravi105173@gmail.com
  Subject: Re: BUG #18883: Epoch issue
  In-Reply-To: <18883-2c45e318b3a3e513@postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox