Convert an R object to a date object that can be used in a WHERE clause.

to.db.date(val, origin = "1970-01-01")