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. For example I want to do something like the
following...
<?php
$time_started = time();
INSERT INTO surveys (name, time_started, time_ended) VALUES
('somename',$time_start,$time_ended);
?>
Both the "time_started" and "time_ended" fields are defined as postgresql
timestamps.
The problem is that the "$time_started" variable is seconds since the epoch,
and postgresql wants a timestamp value. Isn't there a simple way to do this
inside the INSERT script without having to resort to application level
scripting???
I have been searching around the net, and looked at the manual but have had
no luck finding a solution.
Thanks in advance,
Alan