How can I round a timestamp to the nearest day in postgresql. I have tried using function date_trunc('day', d_date::timestamp) but I get that is always staying in the same day.
Example 1:
date_trunc('day' , '1967-12-03 23:00:00')
Result:
1967-12-03 00:00:00.000000
Expected:
1967-12-04 00:00:00.000000
Example 2: (This one works fine)
date_trunc('day' , '1967-12-03 00:00:00')
Result:
1967-12-03 00:00:00.000000
Expected:
1967-12-03 00:00:00.000000