Bug in date formatting and tests to check - fixes #1199