Closed germanotm closed 4 years ago
Needed a way to select the full date with year-month-day from a datetime column, therefore, I added a date option to DATETIME_HIERARCHIES array.
date
On mysql there is a DATE() function to do that:
DATE()
mysql> select DATE("2010-02-05 3:00:00"); +----------------------------+ | DATE("2010-02-05 3:00:00") | +----------------------------+ | 2010-02-05 | +----------------------------+
In order to also support this on postgres, I used postgres DATE() function, because there is no such option on date_trunc
date_trunc
postgres=# SELECT DATE(TIMESTAMP '2020-02-05 3:00:00'); date ------------ 2020-02-05
Needed a way to select the full date with year-month-day from a datetime column, therefore, I added a
date
option to DATETIME_HIERARCHIES array.On mysql there is a
DATE()
function to do that:In order to also support this on postgres, I used postgres
DATE()
function, because there is no such option ondate_trunc