format method
Converts a DateTime into a formatted string using the given format
.
Returns an empty string if date
is null.
Example:
DateTimeUtils.dateToString(DateTime.now(), format: "yyyy-MM-dd");
Implementation
String format(String format) {
return DateFormat(format).format(this);
}