convert dates to POSIXlt

Include an extra check to convert date variables to POSIXlt format.