cast string input to date