how to use date_trunc in postgresql” Code Answer

For PostgreSQL this is feasible to reduce, or complete current time standard to a particular amount of exactness. For instance, if someone desires to decrease his date and time standards to the coming hour or the coming week. The DATE_TRUNC() purpose creates feasibility to cope with this shortness.
In this section we will give an overview to the date_trunc() function for PostgreSQL and see some illustration that how we can utilize this.

PostgreSQL date_trunc() Syntax
We see the fundamental syntax used for date_trunc() function.
date_trunc('interval',field)

date_trunc postgres

on Jan 01, 1970
SELECT DATE_TRUNC('hour', TIMESTAMP '2017-03-17 02:09:30');

Add Comment

0


Finally,while we recover date and time information by PostgreSQL,we could not everytime desire the specific current time value.Lukily,this is feasible to up or reduce the current time values by the aid of DATE_TRUNC() function in PostgreSQL.

SQL answers related to "psql date_trunc"

View All SQL queries

SQL queries related to "psql date_trunc"

Browse Other Code Languages

CodeProZone