Time constructor

Time(
  1. int hour,
  2. int minute,
  3. int second,
  4. int subsecond,
)

Creates a new Time given field values

See the Rust documentation for try_new for more information.

Throws CalendarError on failure.

Implementation

factory Time(int hour, int minute, int second, int subsecond) {
  final result = _icu4x_Time_create_mv1(hour, minute, second, subsecond);
  if (!result.isOk) {
    throw CalendarError.values[result.union.err];
  }
  return Time._fromFfi(result.union.ok, []);
}