iso method

String iso({
  1. bool showDate = true,
  2. bool showTime = false,
  3. bool useTimezone = false,
})

Returns parametric iso8601 string

Implementation

String iso({
  bool showDate = true,
  bool showTime = false,
  bool useTimezone = false,
}) {
  final String date = toIso8601String().split("T")[0];
  final String time = toIso8601String().split("T")[1].split('.')[0];
  String res = '';
  if (showDate) {
    res += date;
  }
  if (showTime) {
    res += time;
  }
  if (useTimezone) {
    res += "Z";
  }
  return res;
}