Git's date parsing code, broken out into a library