RE: [PEAR-DEV] MDB & postgresql timestamptz
| From: | Lukas Smith | Date: | Mon, 16 Jun 2003 10:31:22 +0000 |
| Subject: | RE: [PEAR-DEV] MDB & postgresql timestamptz | ||
| References: | 1 | Groups: | php.pear.dev php.pear.general |
| Request: | Send a blank email to pear-dev+get-17511@lists.php.net to get a copy of this message | ||
> From: Jeroen Houben [mailto:jeroen@terena.nl]
> Sent: Monday, June 16, 2003 11:59 AM
> 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.
As far as I know there is no way to represent timezone data in the MDB
format since this is also not available in Metabase ..
You would have to store this data in a separate field.
Regards,
Lukas