public inbox for [email protected]
help / color / mirror / Atom feedFrom: Adrian Klaver <[email protected]>
To: Rich Shepard <[email protected]>
To: [email protected]
Subject: Re: Convert date and time colums to datetime
Date: Sun, 19 Oct 2025 07:56:57 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<[email protected]>
On 10/19/25 07:53, Adrian Klaver wrote:
> On 10/19/25 07:43, Rich Shepard wrote:
>> The database has a table with separate date and time columns.
>>
>> 1. Are there benefits to merging the two into a single timestamp column?
>
> 1) One less column to fetch from.
>
> 2) If you really need a timestamp the work is already done, instead of
> building on the fly.
>
>>
>> 2. If so, how would I do this? (Reading date/time operators and functions
>> doc page hasn't shown me one.)
>
> select ('10/19/2025'::date + '07:50'::time)::timestamptz;
>
> timestamptz
> ------------------------
> 2025-10-19 07:50:00-07
Should have added in previous post, the above assumes your current date
and time values are from the server timezone.
>
>>
>> TIA,
>>
>> Rich
>>
>>
>>
>
>
--
Adrian Klaver
[email protected]
view thread (6+ messages) latest in thread
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]
Subject: Re: Convert date and time colums to datetime
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