On Monday 30 December 2002 21:57, Chris Boget wrote:
> > >o Pg doesn't have DATE_FORMAT()
> >
> > to_char() accomplishes the same thing, for example:
> > select to_char(lastlogin, 'FMMM-DD-YYYY FMHH:MI AM') as lastloginf
> > from users;
>
> Unless I missed something, that function doesn't work with unix timestamps.

No, it only works on pg's date/time formats.

> Is there anythin internal to PG that allows you to convert to and from unix
> timestamps?

Best to store date/time in pg's format rather than unix timestamp.

If you've got legacy data which are stored as unix timestamps then you can do 
one of the following:

1) Do a one time conversion from unix timestamp to pg date/time
2) Manipulate the dates in PHP instead
3) Write your own function in pg to convert them on the fly

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Griffin's Thought:
        When you starve with a tiger, the tiger starves last.
*/


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to