MDB & postgresql timestamptz
| From: | Jeroen Houben | Date: | Mon, 16 Jun 2003 09:59:27 +0000 |
| Subject: | MDB & postgresql timestamptz | ||
| Groups: | php.pear.dev php.pear.general | ||
| Request: | Send a blank email to pear-dev+get-17507@lists.php.net to get a copy of this message | ||
Hi,
I'm trying to insert data into a Postgresql table with a timestamptz (with timezone) field. Here's my query:
$doc_id = $db->nextId('documents_id');
$db->query('INSERT INTO documents VALUES
('.
$db->getIntegerValue($doc_id).','.
$db->getTextValue($_FILES['file']['name']).','.
$db->getIntegerValue($_FILES['file']['size']).','.
$db->getTextValue($_FILES['file']['type']).','.
$db->getTextValue($_POST['description']).','.
$db->getTimestampValue(mktime())
.')');
The error I get is: [nativecode = ERROR: Bad timestamp external representation '1055756194' ]
Timestamptz values look like this in Postgresql: 2002-05-30 13:53:48+02, which is different from mysql IIRC correctly.
I could not find any method in MDB that converts timestamps to this format.
Any ideas?
Jeroen