date_to_string is a Javscript function for transforming a date object into a formatted string.