Convert a date to a Unix timestamp.