Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
jontro
on June 8, 2017
|
parent
|
context
|
favorite
| on:
Working with time in Postgres
Reading the end of the sentence "within the past week:" just above. However I would be interested to know if the "last week" date range is easily doable in postgres :)
craigkerstiens
on June 8, 2017
[–]
Will try to clarify it a bit further. Offhand you could probably do something like the following to find if it fell within some week range:
created_at BETWEEN (date_trunc('week', now())) AND (date_trunc('week', now() - '1 week'::interval))
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: