setHour method

DateTime setHour(
  1. int hour
)

Implementation

DateTime setHour(int hour) {
  var d = dateToString(this, pattern: "yyyy/MM/dd HH:mm");

  return strToDate(
      "${d.split(" ")[0]} ${hour.toString().padLeft(2, "0")}:${d.split(":")[1]}",
      pattern: "yyyy/MM/dd HH:mm");
}