Added a function to get a formatted date string.