Make sure datetime is cast as int