toDateTime method

DateTime toDateTime({
  1. bool isUtc = false,
})

Converts this Tm back into a Dart DateTime.

Implementation

DateTime toDateTime({bool isUtc = false}) {
  if (isUtc) {
    return DateTime.utc(tm_year + 1900, tm_mon + 1, tm_mday, tm_hour, tm_min, tm_sec);
  } else {
    return DateTime(tm_year + 1900, tm_mon + 1, tm_mday, tm_hour, tm_min, tm_sec);
  }
}