In order to Extract date part from timestamp in postgresql we will first typecasting them to timestamp and then date. Let’s see how to
- Extract date part from timestamp in Postgresql
We will be using student_detail table.
Extract date part from timestamp in postgresql:
we will first typecaste the column to timestamp and then typecaste to date as shown below, which in turn keeps only the date value which will result in extracting date from timestamp
select *,birthdaytime :: timestamp :: date from student_detail
So the resultant dataframe with date extracted from timestamp will be