Python date counter converter