Fixed issues with negative dates and millisecond scale