toIso8601 method

String toIso8601({
  1. bool includeTime = true,
})

Returns an ISO8601 String representing this. If includeTime is set to true, the time will be included, and the format will be "yyyy-mm-ddT00:00:00.000000". If includeTime is set to false, the time will be excluded, and the format will be "yyyy-mm-dd".

Implementation

String toIso8601({final bool includeTime = true}) {
  if (includeTime) {
    return _date.toIso8601String();
  } else {
    return _date.toIso8601String().substring(0, 10);
  }
}