What are the challenges you face when working across database platforms? Take the survey

Invalid date value generated

kcurleykcurley Posts: 2
I'm recently used the SQL Data Generator (version to generate test data for one of my applications. In the process, I encountered an issue where a date value generated by the Data Generator was an invalid date. The date value generated was Apr 4, 1992, 2:53 AM EST, which according to the daylight savings is invalid (since the clock jumped from 2:00 to 3:00.

The SQL Server DB allowed this invalid date value to be created and the JDBC driver did not throw an exception when the value was retrieved from the DB. Instead, the JDBC driver auto-corrected the date value, incrementing the hour value by one hour to insure it's a valid date. Management Studio showed the time as 2:53 while my app showed the time as 3:53 after the value was retrieved through the JDBC driver.


  • Options
    Thanks for your post.

    I don't think Data Generator performs validation to account for DST which is why you have encountered this issue.

    I've logged it as a bug (ref SDG-923) although the problem is a bit more complex than it would initially appear. I don't think all regions necessarily switch daylight savings at the same point (so the US will perhaps do it a couple of weeks after/before the UK for instance). This means the invalid date you have could well be valid in another country!

    So, it may be possible to fix it, but we'd also need to investigate region checking, and would it be the region of your PC, or the SQL Server you're working against (they could be different...)

    In any case, I've logged it, as I mentioned above, and we'll let you know if a fix becomes available.
    Systems Software Engineer

    Redgate Software

Sign In or Register to comment.