Fix date format issues on MS SQL Server (#1488918)
Simplified db connection initialisation code