Re: Re: to_timestamp question - Mailing list pgsql-general

From Feite Brekeveld
Subject Re: Re: to_timestamp question
Date
Msg-id 3AB90284.67C5488D@osiris-it.nl
Whole thread Raw
In response to to_timestamp question  (Feite Brekeveld <feite.brekeveld@osiris-it.nl>)
List pgsql-general
Karel Zak wrote:

> On Wed, Mar 21, 2001 at 06:20:21PM +0100, Feite Brekeveld wrote:
> > Hi,
> >
> > I need to convert thisone into an integer timestamp value:
> >
> > 14:57:55.540 UTC Sun Mar 4 2001
> >
> > How to deal with the milliseconds part (.540) and the timezone UTC ?
>
>  Not implmented yet. In 7.2...

... I've found out that ...

tmp_string := '14:57:55.540 UTC Sun Mar 4 2001';
date_part(''epoch'', cast(tmp_string AS DATETIME))


will do the job.

I've got 3600 seconds difference but that probably has to do with my
timezone.

Feite

>
>
>                         Karel
>
> --
>  Karel Zak  <zakkr@zf.jcu.cz>
>  http://home.zf.jcu.cz/~zakkr/
>
>  C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://www.postgresql.org/search.mpl

--
Feite Brekeveld
feite.brekeveld@osiris-it.nl
http://www.osiris-it.nl
---------------------------------------------------------------------------
Whenever you buy a stock be ready to ride the bull and never get eaten by
the bear.



pgsql-general by date:

Previous
From: Alfred Perlstein
Date:
Subject: someone forward me Bruce's mail about the interview please?
Next
From: Jan Ploski
Date:
Subject: Re: Hope it is not too offtopic