Change a way of creating new dates in test.

Close #1242.
Change formatting.
Merge pull request #1244 from palantir/1242_date_test

Change a way of creating new dates in test.