I can see why you’re a bit confused here, the question is poorly written. You can not use the Prelude filter function to do this, but you do need to write a function that filters and maps over the data to do this transformation (onlyDateTimes below is an example type signature for such a function).
mapMaybe is the sort of function you may to use for this purpose.
Here are some type signatures as a hint for one way to implement it:
dbDateTime :: DatabaseItem -> Maybe UTCTime
onlyDateTimes :: [DatabaseItem] -> [UTCTime]
There are of course other ways to implement onlyDateTimes such as directly using pattern matching and recursion, or using foldr, concatMap, etc. I would go with whichever method you’ve learned from the textbook so far.