I have date and time stored in postgres as timestamp format in postgres like this:
created_time timestamp without time zone DEFAULT now(),
now I want to search for rows that have created_time between date_before and date_after fields. both these fields are query strings.
How can i filter data with this?
In Postgres, you can simply compare the timestamp with the strings:
select *
from your_table
where created_time >= '2020-06-22 19:10:25-07'
and created_time < '2020-06-23 19:10:25-07'
Remember not to use between with time stamps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With