Converts date to a string in the format described by format.
date
format
a DateTime
the format to generate the date in
date as a string or null