Fix to and from Date object