A simple characterization of doubly twisted spacetimes