1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-03 15:18:01 +00:00
Files
til/postgres/intervals-of-time-by-week.md
2015-07-02 08:45:41 -05:00

333 B

Intervals Of Time By Week

It is pretty common to use hours or days when creating a Postgres interval. However, intervals can also be created in week-sized chunks

> select '2 weeks'::interval;
 interval
----------
 14 days
(1 row)

> select make_interval(0,0,7,0,0,0,0);
 make_interval
---------------
 49 days
(1 row)