Postgresql – How to get value from range datetime from date format to bigint in postgresql

postgresql

I'm new using postgresql and had difficult to convert datetime to bigint type. So my tables has column timecreated that datatype is bigint. I want to get value with range datetime format like dd/mm/yyyy example : select * from mytables where timecreated_at between '01/09/2021' and '10/09/2021' . How i can achieved this?

Best Answer

You do not convert datetime to bigint, you use timestamp with time zone. To convert a string to a timestamp with time zone, use the to_timestamp function.