RE: date function bug

From: Kevin Brannen <KBrannen(at)efji(dot)com>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: RE: date function bug
Date: 2019-10-23 14:44:21
Message-ID: DM6PR19MB3451B74FE5D084C0B2F08612A46B0@DM6PR19MB3451.namprd19.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

From: Ravi Krishna <sr_krishna(at)aol(dot)com>

> postgres=# select to_date('2018150X','YYYYMMDD');
> to_date
------------
> 2019-03-03

> postgres=# select to_date('20181501','YYYYMMDD');
> to_date
> ------------
> 2019-03-03

is this a cut-n-paste mistake?

====================
Surprisingly (to me), no….
db=# select to_date('20181501','YYYYMMDD');
to_date
------------
2019-03-03
(1 row)

Time: 0.497 ms
nms=# select version();
version
----------------------------------------------------------------------------------------------------------
PostgreSQL 9.6.5 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-16), 64-bit
(1 row)

Time: 0.247 ms
db=#

This e-mail transmission, and any documents, files or previous e-mail messages attached to it, may contain confidential information. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are hereby notified that any disclosure, distribution, review, copy or use of any of the information contained in or attached to this message is STRICTLY PROHIBITED. If you have received this transmission in error, please immediately notify us by reply e-mail, and destroy the original transmission and its attachments without reading them or saving them to disk. Thank you.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2019-10-23 14:44:52 Re: date function bug
Previous Message Ron 2019-10-23 14:43:28 Re: date function bug