Joining dates/times (was Re: Splitting Timestamps)

Поиск
Список
Период
Сортировка
От Ron Johnson
Тема Joining dates/times (was Re: Splitting Timestamps)
Дата
Msg-id 44CC63C8.50603@cox.net
обсуждение исходный текст
Ответ на Re: Splitting Timestamps  (Alvaro Herrera <alvherre@commandprompt.com>)
Ответы Re: Joining dates/times (was Re: Splitting Timestamps)  (Andreas Kretschmer <akretschmer@spamfence.net>)
Re: Joining dates/times (was Re: Splitting Timestamps)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alvaro Herrera wrote:
> Chris Hoover wrote:
>> I have several columns in my database that are timestamps.  My developers
>> are asking me how to split the timestamp so that they can look at either the
>> date or at the time portion.
>>
>> I know I can do a select to_date(now(),'yyyy-mm-dd') and it will return the
>> date.  However, how do I get the time?  Also, is this the proper way to get
>> the date portion of a timestamp?
>
> select now()::timetz;
> select now()::time;
> select now()::date;

What's the inverse?  Say I have a DATE and a TIME, and want to
create a TIMESTAMP with them?

- --
Ron Johnson, Jr.
Jefferson LA  USA

Is "common sense" really valid?
For example, it is "common sense" to white-power racists that
whites are superior to blacks, and that those with brown skins
are mud people.
However, that "common sense" is obviously wrong.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEzGPIS9HxQb37XmcRAgWyAKCE/xGJrieisqqHcwxFGcreQfFG8wCggL8n
wiDGRD0xekMKVb01R1uPM4I=
=hE1R
-----END PGP SIGNATURE-----

В списке pgsql-general по дате отправления:

Предыдущее
От: Francisco Reyes
Дата:
Сообщение: Corrupted DB? could not open file pg_clog/####
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: Joining dates/times (was Re: Splitting Timestamps)