fixed incorrect date handling #396