Re: Issue with date/timezone conversion function

2024-04-09 Thread Adrian Klaver
On 4/9/24 11:24, Lok P wrote: On Tue, Apr 9, 2024 at 10:33 PM Tom Lane > wrote: 'EST' is going to rotate to UTC-5, but that's probably not what you want in the summer.  I'd suggest AT TIME ZONE 'America/New_York' or the like.  See

Re: Issue with date/timezone conversion function

2024-04-09 Thread yudhi s
Below should work... date_trunc('hour', timestamp_column *AT TIME ZONE '*America/New_York') + (((date_part('minute', timestamp_column *AT TIME ZONE '*America/New_York')::int / 15)::int) * interval '15 min') On Tue, Apr 9, 2024 at 11:54 PM Lok P wrote: > > On Tue, Apr 9, 2024 at 10:33 PM Tom

Re: Issue with date/timezone conversion function

2024-04-09 Thread Lok P
On Tue, Apr 9, 2024 at 10:33 PM Tom Lane wrote: > Lok P writes: > > These tables are INSERT only tables and the data in the create_timestamp > > column is populated using the now() function from the application, which > > means it will always be incremental, and the historical day transaction >

Re: Issue with date/timezone conversion function

2024-04-09 Thread Tom Lane
Lok P writes: > These tables are INSERT only tables and the data in the create_timestamp > column is populated using the now() function from the application, which > means it will always be incremental, and the historical day transaction > count is going to be the same. However surprisingly the

Re: Issue with date/timezone conversion function

2024-04-09 Thread Adrian Klaver
On 4/9/24 9:16 AM, Lok P wrote: On Tue, Apr 9, 2024 at 9:26 PM Adrian Klaver > wrote: On 4/9/24 08:43, Lok P wrote: > Hi All, > It's version 15.4 of postgresql database. Every "date/time" data type > attribute gets stored in the

Re: Issue with date/timezone conversion function

2024-04-09 Thread Lok P
On Tue, Apr 9, 2024 at 9:26 PM Adrian Klaver wrote: > On 4/9/24 08:43, Lok P wrote: > > Hi All, > > It's version 15.4 of postgresql database. Every "date/time" data type > > attribute gets stored in the database in UTC timezone only. One of the > > support persons local timezone is

Re: Issue with date/timezone conversion function

2024-04-09 Thread Adrian Klaver
On 4/9/24 08:43, Lok P wrote: Hi All, It's version 15.4 of postgresql database. Every "date/time" data type attribute gets stored in the database in UTC timezone only. One of the support persons local timezone is "asia/kolkata" and  that support person needs to fetch the count of transactions