Date conversion test, refactoring