formattedTime property

String get formattedTime

Returns a random time formatted for locale.

Example:

Date().formattedTime; // "14:27:03"

Implementation

String get formattedTime {
  final random = Random(seed);
  final hour = random.integer(max: 23).toString().padLeft(2, '0');
  final minute = random.integer(max: 59).toString().padLeft(2, '0');
  final second = random.integer(max: 59).toString().padLeft(2, '0');
  return DateData.locale(
    locale,
  ).formatTime(hour: hour, minute: minute, second: second);
}