On 4 Apr 2004, at 12:08, Alan T. Miller wrote:
> I have a PHP script that captures the time using the PHP time()
> function. I
> want to insert this time into a postgresql table timestamp field. I am
> at a
> loss on how to do this. ...
If you have a Unix-style timestamp (seconds since 1970-01-01 00:00) you
can convert it to a PostgreSQL timestamp like this:
select timestamp '1970-01-01' + interval '953559481 seconds';
There might be a better way, but that's how I solved it.
---
Richard Brooksby <rb(at)ravenbrook(dot)com>
Senior Consultant
Ravenbrook Limited <http://www.ravenbrook.com/>
PO Box 205, Cambridge CB2 1AN, United Kingdom
Voice: +44 777 9996245 Fax: +44 870 1641432