The Postgresql query below should return the following date type ti varchar() type but its giving error. I've even tried it with convert(using return also), but still it's giving error.
CREATE FUNCTION TimePart( fDate out date )
--RETURNS date
AS $$
BEGIN
cast(fDate AS char(10));
END;
$$ language 'sql'