Added support for using Date objects or timestamps