Re: Conversion errors for datetime fields
Larry Rosenman <ler@lerctr.org>
From: Larry Rosenman <ler@lerctr.org>
To: pgsql-bugs@postgresql.org
Date: 2000-12-28T17:16:25Z
Lists: pgsql-bugs
* Tom Lane <tgl@sss.pgh.pa.us> [001228 10:28]: > pgsql-bugs@postgresql.org writes: > regression=# select now()::date+'0:00:59.999'::time; > ?column? > --------------------------- > 2000-12-28 00:00:60.00-05 > (1 row) > > The cause is clear enough: the 59.999 seconds are being rounded off > to two digits for display. But it's unfortunate that this causes a > displayed output that will not be accepted as valid input. Perhaps > it would be a good idea to round off the seconds to display precision > *before* the value is broken down to hh/mm/ss. Aren't we *REQUIRED* by SQL99 to accept up to :61 to account for leap seconds? -- Larry Rosenman http://www.lerctr.org/~ler Phone: +1 972-414-9812 E-Mail: ler@lerctr.org US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749