On Wed, Mar 17, 2004 at 11:52:19 -0700,
  Robin 'Sparky' Kopetzky <[EMAIL PROTECTED]> wrote:
> Good Morning!!
> 
>       I'm repairing a series of scripts in PHP that use the 'datetime' of MySQL
> and converting them to Postgres. Question is this: The datetime format used
> in the script is 'YYYYMMDDHHMMSS' as a text string. Do I have to convert
> this to the format shown in the Postgres manual: '1999-01-08 04:05:06' for
> Postgres to accept the value or can I just pass an integer as 19990108040506
> for the timestamp?

You certainly couldn't have it as an integer. Even as type unknown
(which you get by quoting the constant) it doesn't work. You can use
to_timestamp to convert the string. For example:
bruno=> select to_timestamp('19990108040506', 'YYYYMMDDHH24MISS');
      to_timestamp
------------------------
 1999-01-08 04:05:06+00
(1 row)

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to