properly formats date-string.