Thread: to_timestamp question

to_timestamp question

From
Feite Brekeveld
Date:
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 ?


Thanks,

--
Feite Brekeveld
feite.brekeveld@osiris-it.nl



Re: to_timestamp question

From
Karel Zak
Date:
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...

                        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

Re: Re: to_timestamp question

From
Feite Brekeveld
Date:
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.