setHour method

DateTime setHour(
  1. int hour, [
  2. int? minute,
  3. int? second,
  4. int? millisecond,
  5. int? microsecond,
])

Change hour of this date

set minute if you want to change it as well, to skip an change other optional field set it as null set second if you want to change it as well, to skip an change other optional field set it as null set millisecond if you want to change it as well, to skip an change other optional field set it as null set microsecond if you want to change it as well

Implementation

DateTime setHour(
  int hour, [
  int? minute,
  int? second,
  int? millisecond,
  int? microsecond,
]) =>
    DateTime(
      year,
      month,
      day,
      hour,
      minute ?? this.minute,
      second ?? this.second,
      millisecond ?? this.millisecond,
      microsecond ?? this.microsecond,
    );