clone of https://github.com/Tieske/date