Format DateTime strings, including handling null