I used the `date_to_string` function since that's being used in other parts of the file already.