Convert dates for MongoDB.