Convert dates to milliseconds