Menu

#1213 (Ingres) date_trunc on hour/minutes/seconds always subtracting 7 hours from result

None
open
nobody
None
5
2018-12-22
2015-08-19
No

Running the following query:

select '31-Oct-2000 08:55:12',
date_trunc('HOURS','31-Oct-2000 08:55:12'),
date_trunc('MINUTES','31-Oct-2000 08:55:12'),
date_trunc('SECONDS','31-Oct-2000 08:55:12');

will yield:

            col1            |              col2              |               col 3              |               col4

------------------------------- | -------------------------------- | ---------------------------------- | --------------------------------
31-Oct-2000 08:55:12 | 2000-10-31 01:00:00.0 l 2000-10-31 01:55:00.0 | 2000-10-31 01:55:12.0

It might be useful to know that
select date('now')
yields the correct time.

Discussion


Log in to post a comment.