Time constructor

Time([
  1. int hour = 0,
  2. int minute = 0,
  3. int second = 0,
  4. int millisecond = 0,
  5. int microsecond = 0,
])

Construct a Time instance.

Time value must be positive and not larger than 24:00:00.000000.

Implementation

factory Time([
  int hour = 0,
  int minute = 0,
  int second = 0,
  int millisecond = 0,
  int microsecond = 0,
]) {
  return Time.fromMicroseconds(hour * Duration.microsecondsPerHour +
      minute * Duration.microsecondsPerMinute +
      second * Duration.microsecondsPerSecond +
      millisecond * Duration.microsecondsPerMillisecond +
      microsecond);
}