public inbox for [email protected]
help / color / mirror / Atom feedFrom: [email protected] <[email protected]>
To: [email protected] <[email protected]>
To: Adrian Klaver <[email protected]>
Subject: Re: Retrieving current date
Date: Fri, 20 Jun 2025 11:08:41 +0000 (UTC)
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
<[email protected]>
Thanks all,
I just changed the timezone setting in postgresql.conf file. That resolved this issue.
On Thursday 19 June, 2025 at 07:41:16 pm IST, Adrian Klaver <[email protected]> wrote:
On 6/18/25 23:23, [email protected] wrote:
> Hello,
> May be a very basic question. We all here are new to Linux / PostgreSQL
>
> Ubuntu Server 22.04
> PostgreSQL 15
> PgAdmin4 6.16
>
> When I run the following query in pg_admin
>
> Select today_now
> From (Select localtimestamp(0) as today_now) a;
>
> I get UTC time and not the IST time, which I expect.
>
> How to change the setting(s), if any, to retrieve the current date and
> time in IST?
For setting see:
https://www.postgresql.org/docs/current/runtime-config-client.html
"TimeZone (string)
Sets the time zone for displaying and interpreting time stamps. The
built-in default is GMT, but that is typically overridden in
postgresql.conf; initdb will install a setting there corresponding to
its system environment. See Section 8.5.3 for more information.
"
For a quick fix, maybe?:
select localtimestamp(0) at time zone 'Asia/Kolkata' as today_now;
>
> Happiness Always
> BKR Sivaprakash
>
--
Adrian Klaver
[email protected]
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: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Retrieving current date
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox