code: def extract_date(value):
      
      dtime = value.to_datetime()
      dtime = (dtime - timedelta(hours=dtime.hour) - timedelta(minutes=dtime.minute) -
               timedelta(seconds=dtime.second) - timedelta(microseconds=dtime.microsecond))
      return dtime
docs: Convert timestamp to datetime and set everything to zero except a date