fixed creation of a Date object in JSON format