Fixed date marshalling, the previous implementation coudl lead to bad
dates when a date is selected aroudn daylight saving timzone changes