Improves date conversion. Adds mode selection into test application.