Re: Create Timestamp From Date and Time

From: Jean-Christian Imbeault <jc(at)mega-bucks(dot)co(dot)jp>
To: "Ron St(dot)Pierre" <rstpierre(at)syscor(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Create Timestamp From Date and Time
Date: 2002-11-27 16:35:52
Message-ID: 3DE4F468.9040209@mega-bucks.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ron St.Pierre wrote:
> Example - when I run the following:
> select timestamp(date '1998-02-24',time '23:07')
> I get the following error:
> parse error at or near "date"

what you want is:

select to_timestamp('1998-02-24 23:07'::text, 'YYYY-MM-DD HH:MI');
to_timestamp
------------------------
1998-02-24 23:07:00+09
(1 row)

Have a look at:

http://www.postgresql.org/idocs/index.php?functions-formatting.html

Jc

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Neil Conway 2002-11-27 16:39:04 Re: rename
Previous Message Achilleus Mantzios 2002-11-27 16:35:20 Re: FreeBSD, Linux: select, select count(*) performance