-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
Ron Johnson [EMAIL PROTECTED] schrieb:
I know I can do a select to_date(now(),'-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
On Sun, Jul 30, 2006 at 10:00:30AM +0200, Andreas Kretschmer wrote:
Ron Johnson [EMAIL PROTECTED] schrieb:
I know I can do a select to_date(now(),'-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
Ron Johnson [EMAIL PROTECTED] writes:
What's the inverse? Say I have a DATE and a TIME, and want to
create a TIMESTAMP with them?
Add 'em together, using the date + time or date + timetz operator:
regression=# select current_date + '11:57'::time;
?column?
-
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(),'-mm-dd') and it will return the date. However, how do I get the time? Also,
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(),'-mm-dd') and it will return the
date. However,
am 25.07.2006, um 12:54:35 -0400 mailte Chris Hoover folgendes:
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.
The CAST-Operater is your friend:
est=# select
I believe you would want to cast the field
to a date like so select datefield::datefrom table1 or select datefield::time from
table1.
From: Chris Hoover
[mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 25, 2006 11:55
AM
To: pgsql-general@postgresql.org
Subject: [GENERAL] Splitting
On Tue, 2006-07-25 at 12:54 -0400, Chris Hoover wrote:
I know I can do a select to_date(now(),'-mm-dd') and it will
return the date. However, how do I get the time?
Casting is the better option, but the to_date format spec handles a lot
more than just dates. See:
[EMAIL PROTECTED] (Chris Hoover) writes:
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(),'-mm-dd') and it will return
10 matches
Mail list logo