Re: to_date() and to_timestamp() with negative years - Mailing list pgsql-general

From Adrian Klaver
Subject Re: to_date() and to_timestamp() with negative years
Date
Msg-id 30ba14d1-31fc-31ac-aaff-ac42589d7a07@aklaver.com
Whole thread Raw
In response to Re: to_date() and to_timestamp() with negative years  (Adrian Klaver <adrian.klaver@aklaver.com>)
Responses Re: to_date() and to_timestamp() with negative years  (Bryn Llewellyn <bryn@yugabyte.com>)
List pgsql-general
On 11/3/21 17:00, Adrian Klaver wrote:
> On 11/3/21 15:56, Bryn Llewellyn wrote:
>>> tgl@sss.pgh.pa.us wrote:
>>>

>> And you have to have some kind of separator between the years 
>> substring and the adjacent one(s) even to succeed with years that have 
>> more than four digits. Another usage note stresses that while this is OK:
>>
>> select to_date('12340101', 'YYYYMMDD');
>>
>> this isn't:
>>
>> select to_date('123450101', 'YYYYMMDD');
> 
> It does with a tweak:
> 
> select to_date('12345 0101', 'FMYYYYMMDD');
>     to_date
> -------------
>   12345-01-01

Well that was just plain wrong. I was not paying attention.



-- 
Adrian Klaver
adrian.klaver@aklaver.com



pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: to_date() and to_timestamp() with negative years
Next
From: Peter Geoghegan
Date:
Subject: Re: Error with Insert from View with ON Conflict