Re: to_timestamp behaviour

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marcel Ruff <mr(at)marcelruff(dot)info>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: to_timestamp behaviour
Date: 2013-01-30 01:23:36
Message-ID: 18984.1359509016@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Marcel Ruff <mr(at)marcelruff(dot)info> writes:
> I do this ISO date query:

> select to_timestamp('2012-07-06T23:17:39.668Z', 'YYYY-MM-DD\THH24:MI:SS.MS'),
> '2012-07-06T23:17:39.668Z' AS ORIGINAL;

> to_timestamp | original
> ----------------------------+--------------------------
> 2012-07-06 03:17:39.668+00 | 2012-07-06T23:17:39.668Z
> (1 row)

I see nothing in the to_timestamp documentation suggesting that
backslash is how to quote constant text. Try it like this:

select to_timestamp('2012-07-06T23:17:39.668Z', 'YYYY-MM-DD"T"HH24:MI:SS.MS');

regards, tom lane

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Justus Mugbeh 2013-01-30 19:58:43
Previous Message Marcel Ruff 2013-01-29 19:44:46 to_timestamp behaviour