days property

String get days

The day of the month [01..31].

final moonLanding = DateTime.parse('1969-07-02 20:18:04Z');
print(moonLanding.day); // 02

Implementation

String get days {
  if (day.toString().length == 1) {
    return '0$day';
  }
  return day.toString();
}